/* ==========================================================================
   High Tide — "Tide & Gold" identity layer
   ==========================================================================
   Loaded after styles.css. The logo is the brief: gold leaf above a waterline,
   turquoise sea below it, a splash where they meet. Before this layer the game
   spoke a different language from its own logo — ember orange, wine and a
   purple night — so every screen read as a generic dark template.

   What changes here, and nothing else:
     - the palette tokens (styles.css components already read them; the ember
       and wine literals in styles.css were moved onto the same new colours)
     - the type of headings: Cinzel, the logo's chiselled serif family
     - the signature pieces: waterline text, liquid-gold primary button,
       gold-hairline panels with a sea glow at their base, the wave rule
   Semantic colours (danger, tension, the per-character colours, jealousy and
   pact notes) are deliberately left alone: they carry meaning, not brand.
   ========================================================================== */

:root {
    --bg-void: #020c13;
    --bg-deep: #05202b;
    --card-bg: rgba(6, 30, 42, 0.58);
    --card-bg-solid: rgba(4, 21, 30, 0.96);
    --border-soft: rgba(242, 195, 91, 0.14);
    --border-glow: rgba(25, 184, 191, 0.28);

    /* The old accent names keep working; they just mean the logo now. */
    --ember: #f2b84b;        /* gold leaf — the primary accent */
    --ember-soft: #ffd98c;
    --wine: #0b6e78;         /* deep sea */
    --frost: #5fe0dc;        /* foam turquoise */
    --gold: #f4c75e;
    --amber: #ffcf5c;
    --amber-soft: #ffe3a3;

    --sea: #19b8bf;
    --sea-deep: #06414b;
    --foam: #e2fcf8;
    --gold-hi: #fff1bd;
    --gold-lo: #b97a1c;
    --hairline: rgba(244, 199, 94, 0.22);

    /* Gold above the waterline, sea below — the logo's letters, as a fill. */
    --waterline: linear-gradient(180deg, #fff3c4 0%, #f6cb63 30%, #d99a2b 52%, #3fd0cf 53%, #149aa6 72%, #0b5f6e 100%);

    --focus-ring: #5fe0dc;
    --shadow-glow: 0 0 22px rgba(25, 184, 191, 0.10);
    --shadow-btn: 0 6px 22px rgba(242, 184, 75, 0.28);
}

::selection { background: var(--sea); color: #021016; }

/* --- The sea itself -------------------------------------------------------- */
body {
    background-image:
        radial-gradient(ellipse 70% 45% at 50% -8%, rgba(244, 199, 94, 0.10) 0%, transparent 70%),
        radial-gradient(ellipse 60% 50% at 8% 108%, rgba(25, 184, 191, 0.16) 0%, transparent 70%),
        radial-gradient(ellipse 60% 50% at 95% 100%, rgba(11, 110, 120, 0.20) 0%, transparent 70%),
        linear-gradient(180deg, var(--bg-void) 0%, var(--bg-deep) 100%);
}

/* --- Signature: waterline text ------------------------------------------- */
.intro-banner h2,
.modal-card h2 {
    font-family: 'Cinzel', serif;
    font-weight: 800;
    letter-spacing: 0.02em;
    background: var(--waterline);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--gold);
    filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.6)) drop-shadow(0 0 14px rgba(25, 184, 191, 0.18));
}

/* The round title is too small for the waterline split to read (it goes
   muddy green), so it gets the gold half only. Names inside keep their own
   colours. */
#roundTitle {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--gold-hi);
    text-shadow: 0 0 16px rgba(244, 199, 94, 0.25);
}

.intro-banner h2 { font-size: clamp(24px, 2.2vw, 32px); }

/* --- Masthead: the logo, a gold hairline and a wave under it -------------- */
header {
    background:
        linear-gradient(180deg, rgba(4, 22, 31, 0.92), rgba(3, 15, 22, 0.86));
    border-bottom: 1px solid var(--hairline);
}

header::after {
    height: 6px;
    bottom: -6px;
    opacity: 0.9;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='6' viewBox='0 0 80 6'%3E%3Cpath d='M0 3 Q10 0 20 3 T40 3 T60 3 T80 3' fill='none' stroke='%2319b8bf' stroke-opacity='.55' stroke-width='1.2'/%3E%3C/svg%3E") repeat-x center / 80px 6px;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
}

#titleHeader {
    background: none;
    -webkit-text-fill-color: initial;
    line-height: 0;
    display: flex;
    align-items: center;
}

#titleHeader img {
    display: block;
    height: clamp(36px, 3.6vw, 52px);
    width: auto;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 16px rgba(25, 184, 191, 0.18));
    transition: filter 0.25s ease, transform 0.25s var(--ease-pop);
}

h1#titleHeader:hover { filter: none; }
#titleHeader:hover img {
    transform: scale(1.04) rotate(-1deg);
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 22px rgba(244, 199, 94, 0.45));
}

.stat-cluster,
.tide-indicator {
    border-color: var(--hairline) !important;
    background: linear-gradient(180deg, rgba(244, 199, 94, 0.06), rgba(25, 184, 191, 0.05)) !important;
}

.stat-key,
.sea-readout .sea-label { color: rgba(244, 199, 94, 0.72); }

/* --- Panels: navy glass, gold hairline, the sea glowing at the base -------- */
.arena-section,
.sidebar-player-card,
.action-box-group,
.intro-banner,
.modal-card {
    background:
        linear-gradient(180deg, rgba(244, 199, 94, 0.035), transparent 40%),
        var(--card-bg);
    border: 1px solid var(--hairline);
    box-shadow:
        inset 0 1px 0 rgba(255, 241, 189, 0.07),
        inset 0 -40px 50px -40px rgba(25, 184, 191, 0.20),
        0 18px 44px rgba(0, 0, 0, 0.35);
}

.modal-card { background: linear-gradient(180deg, rgba(244, 199, 94, 0.05), transparent 30%), var(--card-bg-solid); }

.modal-card::before {
    background: linear-gradient(160deg, var(--gold-hi), var(--gold) 18%, transparent 40%, transparent 62%, var(--sea) 85%, var(--frost));
    opacity: 0.55;
}

.sidebar-player-card:hover {
    border-color: rgba(244, 199, 94, 0.45);
    box-shadow:
        inset 0 1px 0 rgba(255, 241, 189, 0.1),
        inset 0 -40px 50px -40px rgba(25, 184, 191, 0.3),
        0 10px 30px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(244, 199, 94, 0.15);
}

aside {
    background: linear-gradient(180deg, rgba(3, 18, 26, 0.75), rgba(3, 22, 30, 0.55));
    border-right: 1px solid var(--hairline);
}

/* Section labels: small-caps Cinzel in gold, with a diamond instead of a dot. */
.aside-title,
.action-box-title {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 0.16em;
}

.aside-title { border-bottom: 1px solid var(--hairline); }

.aside-title::before {
    width: 7px;
    height: 7px;
    border-radius: 1px;
    transform: rotate(45deg);
    background: linear-gradient(135deg, var(--gold-hi), var(--sea));
    box-shadow: 0 0 10px rgba(25, 184, 191, 0.6);
    animation: none;
}

.action-box-title { color: var(--frost); }

/* --- Tabs ------------------------------------------------------------------ */
.tabs-navigation { border-bottom: 1px solid var(--hairline); }
.tab-btn { font-family: 'Cinzel', serif; font-weight: 700; letter-spacing: 0.06em; }
.tab-btn.active { color: var(--gold); text-shadow: 0 0 14px rgba(244, 199, 94, 0.35); }
.tab-slider {
    height: 3px;
    background: linear-gradient(90deg, var(--gold-hi), var(--gold) 45%, var(--sea));
    box-shadow: 0 0 12px rgba(25, 184, 191, 0.55);
}

/* --- Buttons ---------------------------------------------------------------
   The primary button is a logo letter: polished gold with the sea risen into
   its lower third behind a wave. */
.btn-harem {
    /* Spaced capitals on every primary, like the draw button. */
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #1b1204;
    text-shadow: 0 1px 0 rgba(255, 244, 200, 0.55);
    border: 1px solid rgba(255, 235, 170, 0.75);
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='40' viewBox='0 0 120 40' preserveAspectRatio='none'%3E%3Cpath d='M0 27 Q15 22 30 27 T60 27 T90 27 T120 27 V40 H0Z' fill='%2312a3ab' fill-opacity='.9'/%3E%3Cpath d='M0 27 Q15 22 30 27 T60 27 T90 27 T120 27' fill='none' stroke='%23e2fcf8' stroke-opacity='.8' stroke-width='1.2'/%3E%3C/svg%3E") bottom / 120px 100% repeat-x,
        linear-gradient(180deg, #fff2c2 0%, #f7cd66 35%, #e1a336 70%, #b97a1c 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.6),
        inset 0 -1px 0 rgba(0, 0, 0, 0.25),
        0 6px 22px rgba(242, 184, 75, 0.25),
        0 0 0 1px rgba(0, 0, 0, 0.35);
}

.btn-harem:hover:not(:disabled) {
    background-position: 60px bottom, 0 0;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        0 8px 30px rgba(242, 184, 75, 0.4),
        0 0 26px rgba(25, 184, 191, 0.35),
        0 0 0 1px rgba(0, 0, 0, 0.35);
}

/* Grows plainly on hover: the pop curve overshot and came back, a zoom in and out. */
.btn-harem { transition: background-position 0.9s ease, box-shadow 0.25s ease, transform 0.2s ease-out; }

/* styles.css gives `.nav-btn:hover` a flat translucent background, which
   would wipe the gold off a `nav-btn btn-harem` the moment you point at it. */
.btn-harem.nav-btn:hover:not(:disabled) {
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='40' viewBox='0 0 120 40' preserveAspectRatio='none'%3E%3Cpath d='M0 27 Q15 22 30 27 T60 27 T90 27 T120 27 V40 H0Z' fill='%2312a3ab' fill-opacity='.9'/%3E%3Cpath d='M0 27 Q15 22 30 27 T60 27 T90 27 T120 27' fill='none' stroke='%23e2fcf8' stroke-opacity='.8' stroke-width='1.2'/%3E%3C/svg%3E") bottom / 120px 100% repeat-x,
        linear-gradient(180deg, #fff2c2 0%, #f7cd66 35%, #e1a336 70%, #b97a1c 100%);
    background-position: 60px bottom, 0 0;
    border-color: rgba(255, 235, 170, 0.9);
}

.action-btn {
    background: linear-gradient(180deg, rgba(25, 184, 191, 0.08), rgba(6, 65, 75, 0.18));
    border: 1px solid rgba(95, 224, 220, 0.22);
    color: var(--foam);
}

.action-btn:hover:not(:disabled) {
    background: linear-gradient(180deg, rgba(244, 199, 94, 0.14), rgba(25, 184, 191, 0.12));
    border-color: var(--gold);
    color: #fff;
    box-shadow: 0 6px 20px rgba(25, 184, 191, 0.22), 0 0 0 1px rgba(244, 199, 94, 0.2);
}

/* :not(.btn-harem) — some primary buttons carry both classes (the arena's
   "Next round" is `nav-btn btn-harem`), and this rule, coming later, used to
   strip their gold and leave dark text on a dark plate. */
.nav-btn:not(.btn-harem) {
    border: 1px solid var(--hairline);
    background: rgba(244, 199, 94, 0.05);
}

.nav-btn:not(.btn-harem):hover:not(:disabled) {
    border-color: rgba(244, 199, 94, 0.5);
    background: rgba(244, 199, 94, 0.1);
}

/* Danger keeps danger's colour: gold would make "this hurts someone" look
   like the safe default. */
.btn-danger-glow {
    color: #ff8f7a !important;
    border-color: rgba(255, 107, 96, 0.35) !important;
}

.btn-danger-glow:hover:not(:disabled) {
    background: rgba(255, 107, 96, 0.14) !important;
    border-color: #ff6b60 !important;
}

/* --- Rules and scrollbars ------------------------------------------------- */
.arena-head,
#roundTitle { border-bottom-color: var(--hairline); }

* { scrollbar-color: rgba(244, 199, 94, 0.35) transparent; scrollbar-width: thin; }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, rgba(244, 199, 94, 0.45), rgba(25, 184, 191, 0.45)); }

/* --- Bowl caption under the 3D bowl matches the logo too ------------------- */
.bowl-caption {
    font-weight: 700;
    background: var(--waterline);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 13px;
}

/* ==========================================================================
   Phase 2 — menu, ticket, windows, icons, setup and endings
   ========================================================================== */

/* --- Icons (src/icons.js) ------------------------------------------------- */
.ht-ico {
    display: inline-block;
    width: 1.2em;
    height: 1.2em;
    vertical-align: -0.25em;
    overflow: visible;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.55));
}

.tide-glyph .ht-ico { width: 26px; height: 26px; vertical-align: middle; }
.sound-toggle .ht-ico { width: 19px; height: 19px; vertical-align: middle; }
.vres-g .ht-ico { width: 17px; height: 17px; }
.vstrain .ht-ico { width: 15px; height: 15px; }
.vrig .ht-ico { width: 15px; height: 15px; vertical-align: -0.2em; }

.sound-toggle {
    border-color: var(--hairline);
    background: linear-gradient(180deg, rgba(244, 199, 94, 0.07), rgba(25, 184, 191, 0.05));
}
.sound-toggle:hover { border-color: rgba(244, 199, 94, 0.55); }
#btnOpenSettings .ht-ico { transition: transform 0.5s var(--ease-pop); }
#btnOpenSettings:hover .ht-ico { transform: rotate(45deg); }

.vres {
    border-color: var(--hairline);
    background: rgba(244, 199, 94, 0.05);
}

/* --- Main menu ------------------------------------------------------------
   Three plaques under the logo, centred, no numerals. Every plaque carries a
   strip of sea at its base that rises and rolls when you point at it; the
   first one is solid gold leaf with the sea inside it — a letter of the logo
   you can press. The secondary two are night glass in a gold hairline. */

/* The shade behind the menu used to be an `ellipse at center` (farthest-corner)
   gradient, which never reaches transparent at the box edges — it showed as a
   dark rectangle on the footage. closest-side fades out before the edges. */
#titleScreen.has-video .title-menu::before {
    inset: -70px -160px;
    background: radial-gradient(closest-side, rgba(2, 10, 16, 0.72), rgba(2, 10, 16, 0.42) 60%, transparent);
}

.title-menu {
    width: min(400px, 100%);
    gap: 12px;
    margin-top: clamp(14px, 3vh, 30px);
}

.title-menu-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 13px 26px 15px;
    border-radius: 14px;
    border: 1px solid rgba(244, 199, 94, 0.30);
    background: linear-gradient(180deg, rgba(8, 36, 48, 0.78), rgba(3, 15, 23, 0.84));
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    box-shadow: inset 0 1px 0 rgba(255, 241, 189, 0.10), 0 10px 30px rgba(0, 0, 0, 0.38);
    color: #f3e6c4;
    text-align: center;
    overflow: hidden;
    transition: transform 0.25s var(--ease-pop), border-color 0.25s ease, box-shadow 0.25s ease;
    /* No blue flash on press: no tap highlight, no text selection, no focus ring
       (the plaque's own glow shows keyboard focus). */
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
    outline: none;
}
.title-menu-btn:focus,
.title-menu-btn:focus-visible,
.title-link:focus { outline: none; }
.title-menu-btn *,
.title-link { -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; }

/* The sea in the plaque: a wave crest on top of a turquoise fill, parked so
   only a sliver shows; hover lets it rise and roll. */
.title-menu-btn::before {
    inset: auto 0 0 0;
    height: 100%;
    z-index: -1;
    opacity: 1;
    border-radius: 0;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='14' viewBox='0 0 80 14'%3E%3Cpath d='M0 8 Q10 2 20 8 T40 8 T60 8 T80 8 V14 H0Z' fill='%23129aa3'/%3E%3Cpath d='M0 8 Q10 2 20 8 T40 8 T60 8 T80 8' fill='none' stroke='%23bff7f2' stroke-opacity='.85' stroke-width='1.3'/%3E%3C/svg%3E") 0 0 / 80px 14px repeat-x,
        linear-gradient(180deg, transparent 13px, #0e8d97 13px, #07505a 100%);
    opacity: 0.55;
    transform: translateY(86%);
    transition: transform 0.6s var(--ease-smooth), opacity 0.4s ease;
}

/* A sweep of light across the plaque on hover (was the side bar). */
.title-menu-btn::after {
    left: -60%;
    top: 0;
    width: 40%;
    height: 100%;
    border-radius: 0;
    background: linear-gradient(105deg, transparent, rgba(255, 246, 214, 0.28), transparent);
    box-shadow: none;
    transform: skewX(-18deg);
    transition: none;
    pointer-events: none;
}

.title-menu-btn:hover:not(:disabled),
.title-menu-btn:focus-visible {
    transform: scale(1.02);
    border-color: rgba(244, 199, 94, 0.85);
    color: #fff6dc;
    outline: none;
    box-shadow:
        inset 0 1px 0 rgba(255, 241, 189, 0.16),
        0 14px 34px rgba(0, 0, 0, 0.45),
        0 0 28px rgba(25, 184, 191, 0.25),
        0 0 0 1px rgba(244, 199, 94, 0.25);
}

.title-menu-btn:hover:not(:disabled)::before,
.title-menu-btn:focus-visible::before {
    opacity: 0.8;
    transform: translateY(74%);
    animation: plaqueWave 2.4s linear infinite;
}

.title-menu-btn:hover:not(:disabled)::after,
.title-menu-btn:focus-visible::after { animation: plaqueShine 0.9s ease-out; }

@keyframes plaqueWave { to { background-position: 80px 0, 0 0; } }
@keyframes plaqueShine { from { left: -60%; } to { left: 130%; } }

.title-menu-btn:disabled {
    opacity: 0.38;
    filter: saturate(0.4);
}

.tm-idx,
.tm-arrow { display: none; }

.tm-text { align-items: center; gap: 3px; }

.tm-label {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 1.0625rem;
    letter-spacing: 0.16em;
}

.tm-meta {
    font-size: 0.75rem;
    letter-spacing: 0.03em;
    color: rgba(226, 252, 248, 0.66);
}

/* The primary plaque: gold leaf, sea risen into its lower third. */
.title-menu-btn.is-primary {
    padding: 17px 26px 19px;
    border: 1px solid rgba(255, 238, 180, 0.9);
    background: linear-gradient(180deg, #fff3c6 0%, #f8d06c 32%, #e5a93b 68%, #b97a1c 100%);
    color: #1d1405;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        inset 0 -1px 0 rgba(0, 0, 0, 0.25),
        0 12px 34px rgba(0, 0, 0, 0.45),
        0 0 38px rgba(244, 199, 94, 0.28);
}

.title-menu-btn.is-primary::before { opacity: 0.95; transform: translateY(82%); }

.title-menu-btn.is-primary:hover::before,
.title-menu-btn.is-primary:focus-visible::before { opacity: 1; transform: translateY(74%); }

.title-menu-btn.is-primary:hover,
.title-menu-btn.is-primary:focus-visible {
    color: #160f03;
    border-color: #fff4c8;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        0 16px 40px rgba(0, 0, 0, 0.5),
        0 0 52px rgba(244, 199, 94, 0.45),
        0 0 0 1px rgba(0, 0, 0, 0.3);
}

.title-menu-btn.is-primary .tm-label {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 0.14em;
}

.title-menu-btn.is-primary .tm-meta { color: rgba(40, 26, 6, 0.78); font-weight: 600; }

/* The footage text-shadows were for light type; on gold they smear. */
#titleScreen.has-video .title-menu-btn.is-primary .tm-label,
#titleScreen.has-video .title-menu-btn.is-primary .tm-meta { text-shadow: 0 1px 0 rgba(255, 244, 200, 0.5); }
#titleScreen.has-video .title-menu-btn .tm-label { text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8); }

/* --- Links under the menu: quiet pills, not a second row of buttons -------- */
.title-links {
    width: min(400px, 100%);
    margin-top: clamp(18px, 3vh, 28px);
    padding-top: 0;
    border-top: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.title-byline {
    margin-bottom: 12px;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(226, 252, 248, 0.6);
}

.title-byline::before,
.title-byline::after {
    content: "";
    width: 42px;
    height: 8px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='42' height='8'%3E%3Cpath d='M0 4h22' stroke='%23f4c75e' stroke-opacity='.5'/%3E%3Cpath d='M24 4c2 0 2-2.4 4.5-2.4S31 4 33 4s2-2.4 4.5-2.4S40 4 42 4' fill='none' stroke='%235fe0dc' stroke-opacity='.8' stroke-width='1.1'/%3E%3C/svg%3E") center / contain no-repeat;
}

.title-byline::after { transform: scaleX(-1); }

.title-links-row {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.title-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 15px 7px 11px;
    border-radius: 999px;
    border: 1px solid rgba(244, 199, 94, 0.25);
    background: rgba(3, 16, 24, 0.6);
}

.title-link.is-support { border-color: rgba(244, 199, 94, 0.45); }
.title-link:hover,
.title-link:focus-visible { border-color: var(--gold); transform: scale(1.03); }

.tl-icon { width: 16px; height: 16px; }
.tl-meta,
.tl-arrow { display: none; }
.tl-label { font-size: 0.8125rem; }

.title-foot { border-top: 0; }

/* --- The drawn ticket -----------------------------------------------------
   Folded: cream stock with a printed gold border and a faint wave watermark.
   Open: a night-sea card in a gold frame, the name in the logo's serif, sealed
   with turquoise wax stamped with a wave. The glow stays the drawn person's
   colour — that is information, not decoration. */
.rt-flap {
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='14' viewBox='0 0 60 14'%3E%3Cpath d='M0 7 Q7.5 1 15 7 T30 7 T45 7 T60 7' fill='none' stroke='%23b0802c' stroke-opacity='.18' stroke-width='1.4'/%3E%3C/svg%3E") repeat-x center / 60px 14px,
        linear-gradient(180deg, #f8edd3, #e3cc9c);
    box-shadow: inset 0 0 0 1px rgba(150, 105, 40, 0.35), inset 0 0 0 5px #f3e4c1, inset 0 0 0 6px rgba(201, 138, 34, 0.75);
}

.rt-body {
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='30' viewBox='0 0 120 30' preserveAspectRatio='none'%3E%3Cpath d='M0 16 Q15 8 30 16 T60 16 T90 16 T120 16 V30 H0Z' fill='%2319b8bf' fill-opacity='.22'/%3E%3Cpath d='M0 16 Q15 8 30 16 T60 16 T90 16 T120 16' fill='none' stroke='%235fe0dc' stroke-opacity='.45' stroke-width='1'/%3E%3C/svg%3E") bottom / 120px 30px repeat-x,
        radial-gradient(ellipse at 50% 0%, rgba(244, 199, 94, 0.14), transparent 60%),
        linear-gradient(170deg, #07222e, #041620 60%, #031018);
}

.rt-body::before {
    inset: 5px;
    border: 1px solid rgba(244, 199, 94, 0.55);
    box-shadow: inset 0 0 0 3px rgba(4, 22, 32, 0.9), inset 0 0 0 4px rgba(244, 199, 94, 0.22);
}

.rt-role { color: var(--gold); font-weight: 700; }

.rt-name {
    font-family: 'Cinzel', serif;
    font-weight: 800;
    font-size: 31px;
    letter-spacing: 0.04em;
}

.rt-seal {
    width: 34px;
    height: 34px;
    right: 9px;
    bottom: 7px;
    color: transparent;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 13c2 0 2-1.6 3.5-1.6S10.5 13 12 13s2-1.6 3.5-1.6S17.5 13 19 13' fill='none' stroke='%23e2fcf8' stroke-opacity='.85' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") center / 70% no-repeat,
        radial-gradient(circle at 35% 30%, #4fe0db, #0f8f9b 55%, #064a54 100%);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6), inset 0 0 0 2px rgba(255, 255, 255, 0.12), 0 0 0 1px rgba(6, 74, 84, 0.8);
}

/* --- Windows --------------------------------------------------------------
   Gold corner flourishes (with a curl of sea inside each) and a wave rule
   under every title. */
.modal-card::after {
    content: "";
    position: absolute;
    inset: 8px;
    pointer-events: none;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='34' height='34'%3E%3Cpath d='M2 22V6a4 4 0 0 1 4-4h16' fill='none' stroke='%23f4c75e' stroke-opacity='.75' stroke-width='1.3'/%3E%3Cpath d='M7 15c0-4.4 3.6-8 8-8' fill='none' stroke='%235fe0dc' stroke-opacity='.7' stroke-width='1.1'/%3E%3Ccircle cx='6' cy='6' r='1.6' fill='%23f4c75e'/%3E%3C/svg%3E") top left / 34px no-repeat,
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='34' height='34'%3E%3Cg transform='translate(34 0) scale(-1 1)'%3E%3Cpath d='M2 22V6a4 4 0 0 1 4-4h16' fill='none' stroke='%23f4c75e' stroke-opacity='.75' stroke-width='1.3'/%3E%3Cpath d='M7 15c0-4.4 3.6-8 8-8' fill='none' stroke='%235fe0dc' stroke-opacity='.7' stroke-width='1.1'/%3E%3Ccircle cx='6' cy='6' r='1.6' fill='%23f4c75e'/%3E%3C/g%3E%3C/svg%3E") top right / 34px no-repeat,
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='34' height='34'%3E%3Cg transform='translate(0 34) scale(1 -1)'%3E%3Cpath d='M2 22V6a4 4 0 0 1 4-4h16' fill='none' stroke='%23f4c75e' stroke-opacity='.75' stroke-width='1.3'/%3E%3Cpath d='M7 15c0-4.4 3.6-8 8-8' fill='none' stroke='%235fe0dc' stroke-opacity='.7' stroke-width='1.1'/%3E%3Ccircle cx='6' cy='6' r='1.6' fill='%23f4c75e'/%3E%3C/g%3E%3C/svg%3E") bottom left / 34px no-repeat,
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='34' height='34'%3E%3Cg transform='translate(34 34) scale(-1 -1)'%3E%3Cpath d='M2 22V6a4 4 0 0 1 4-4h16' fill='none' stroke='%23f4c75e' stroke-opacity='.75' stroke-width='1.3'/%3E%3Cpath d='M7 15c0-4.4 3.6-8 8-8' fill='none' stroke='%235fe0dc' stroke-opacity='.7' stroke-width='1.1'/%3E%3Ccircle cx='6' cy='6' r='1.6' fill='%23f4c75e'/%3E%3C/g%3E%3C/svg%3E") bottom right / 34px no-repeat;
}

.modal-card h2::after {
    content: "";
    display: block;
    width: 150px;
    height: 12px;
    margin: 10px auto 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='12' viewBox='0 0 150 12'%3E%3Cpath d='M0 6h52M98 6h52' stroke='%23f4c75e' stroke-opacity='.5' stroke-width='1'/%3E%3Cpath d='M55 6c3.3 0 3.3-3 6.7-3s3.3 3 6.6 3 3.4-3 6.7-3 3.3 3 6.7 3 3.3-3 6.6-3 3.4 3 6.7 3' fill='none' stroke='%235fe0dc' stroke-width='1.3'/%3E%3C/svg%3E") center / contain no-repeat;
}

.setup-card h2,
.dossier-card h2 {
    font-family: 'Cinzel', serif;
    font-size: clamp(22px, 2vw, 28px);
}

.modal-desc { color: var(--text-muted); }

.modal-img {
    border: 1px solid rgba(244, 199, 94, 0.45);
    box-shadow: 0 0 0 4px rgba(4, 22, 32, 0.9), 0 0 0 5px rgba(244, 199, 94, 0.25), 0 18px 40px rgba(0, 0, 0, 0.55), 0 0 30px rgba(25, 184, 191, 0.15);
}

/* --- Setup ------------------------------------------------------------------ */
.setup-block h3 {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 0.14em;
}

.setup-block {
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(244, 199, 94, 0.10);
}

.setup-cast-btn,
.setup-contract,
.setup-toggle {
    border-color: rgba(244, 199, 94, 0.14);
    background: linear-gradient(180deg, rgba(244, 199, 94, 0.04), rgba(25, 184, 191, 0.03));
}

.setup-cast-btn:hover,
.setup-contract:hover { border-color: rgba(244, 199, 94, 0.45); }

.setup-cast-btn.is-sel,
.setup-contract.is-sel {
    border-color: var(--gold);
    background: linear-gradient(180deg, rgba(244, 199, 94, 0.14), rgba(25, 184, 191, 0.10));
    box-shadow: 0 0 0 1px rgba(244, 199, 94, 0.35), inset 0 -24px 30px -24px rgba(25, 184, 191, 0.45);
}

.setup-cast-btn.is-sel .setup-cast-face {
    border-color: var(--gold);
    box-shadow: 0 0 0 2px #04161f, 0 0 0 3px var(--sea);
}

.setup-cast-name { font-family: 'Cinzel', serif; }

.setup-toggle.is-on {
    border-color: rgba(95, 224, 220, 0.5);
    background: linear-gradient(180deg, rgba(25, 184, 191, 0.12), rgba(25, 184, 191, 0.05));
}
.setup-toggle.is-on .setup-toggle-box { border-color: var(--frost); color: var(--frost); }

.setup-contract-style { color: var(--gold); }

/* The prologue opens like a logbook: a gold drop cap on its first line. */
.setup-beat:first-child::first-letter {
    font-family: 'Cinzel', serif;
    font-size: 2.6em;
    float: left;
    line-height: 0.9;
    margin: 0.06em 0.1em 0 0;
    color: var(--gold);
}

/* --- Endings ----------------------------------------------------------------
   The one screen that should feel like a title card. */
#endingModal .modal-card,
#epilogueModal .modal-card {
    max-width: 760px;
    padding: 40px 38px 34px;
    background:
        radial-gradient(ellipse 80% 40% at 50% 0%, rgba(244, 199, 94, 0.10), transparent 70%),
        radial-gradient(ellipse 90% 40% at 50% 100%, rgba(25, 184, 191, 0.14), transparent 70%),
        var(--card-bg-solid);
}

#endingModal h2,
#epilogueModal h2 {
    font-size: clamp(28px, 3vw, 40px);
    letter-spacing: 0.04em;
}

#endingModal .modal-desc {
    font-size: 1rem;
    line-height: 1.7;
    font-style: italic;
    color: var(--text-main);
    max-width: 56ch;
    margin-inline: auto;
}

.epilogue-text-box {
    background: linear-gradient(180deg, rgba(244, 199, 94, 0.04), rgba(25, 184, 191, 0.04));
    border: 1px solid rgba(244, 199, 94, 0.18);
    border-radius: 12px;
    padding: 18px 20px;
}

.epilogue-text-box h3 {
    font-family: 'Cinzel', serif;
    color: var(--gold);
    letter-spacing: 0.06em;
}

/* --- Scene plates (Media.plateFor) -----------------------------------------
   An empty location still for a social beat, with the two people in the round
   as gold-ringed portrait medallions in the corner. */
.visual-plate-wrapper { position: relative; }

.visual-plate-wrapper::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(0deg, rgba(2, 10, 16, 0.55) 0%, transparent 38%);
}

.plate-faces {
    position: absolute;
    left: 14px;
    bottom: 12px;
    z-index: 1;
    display: flex;
    gap: 12px;
}

.plate-face {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    animation: plateFaceIn 0.5s var(--ease-pop) both;
}

.plate-face + .plate-face { animation-delay: 0.12s; }

@keyframes plateFaceIn {
    from { opacity: 0; transform: translateY(8px) scale(0.9); }
    to   { opacity: 1; transform: none; }
}

.plate-face img {
    width: clamp(48px, 5vw, 68px);
    height: clamp(48px, 5vw, 68px);
    border-radius: 50%;
    object-fit: cover;
    object-position: center top;
    border: 2px solid var(--gold);
    box-shadow: 0 0 0 3px rgba(4, 22, 32, 0.85), 0 6px 16px rgba(0, 0, 0, 0.6), 0 0 18px rgba(25, 184, 191, 0.35);
}

.plate-face figcaption {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.08em;
    color: var(--gold-hi);
    background: rgba(2, 12, 18, 0.65);
    border: 1px solid rgba(244, 199, 94, 0.3);
    padding: 1px 9px;
    border-radius: 999px;
}


/* ==========================================================================
   Phase 3 (24-10-2026) — the pass that finishes the brand
   ==========================================================================
   1. The fonts finally load (src/fonts.css). Until now every Cinzel and Outfit
      line on screen was really Times New Roman and Arial.
   2. Story text gets a book face (Spectral); status lines stay in the UI face,
      so "what happened" and "what changed" no longer look the same.
   3. The screens the first two phases missed: Settings, the history log, the
      action groups, the choice cards, the Locker, the setup backdrop.
   ========================================================================== */

:root {
    --font-prose: 'Spectral', 'Georgia', serif;
    --font-ui: 'Outfit', 'Segoe UI', sans-serif;
    --font-title: 'Cinzel', 'Times New Roman', serif;
}

/* --- Story text in a book face ---------------------------------------------- */
.bubble-text,
.scene-prose,
.intro-banner p,
.setup-beat,
.epilogue-text-box,
.epilogue-text-box p,
#endingModal .modal-desc {
    font-family: var(--font-prose);
}
.bubble-text { font-size: 1.02rem; color: #e9f1ef; }
.scene-prose { font-size: 1rem; font-style: italic; }
.setup-beat { font-size: 1.05rem; color: #dfe9e7; }
.intro-banner p { font-size: 1rem; color: #d7e3e1; }
.intro-banner p strong { font-family: var(--font-ui); font-weight: 600; color: var(--gold-hi); }

/* Speech: a quiet card per line with the speaker's name in small capitals.
   The speaker colour still comes in inline on the left border. */
.speech-bubble {
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012) 70%),
        rgba(4, 22, 32, 0.45);
    border-radius: 4px 14px 14px 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding: 11px 18px 12px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}
.speech-bubble + .speech-bubble { margin-top: 2px; }
.bubble-name {
    font-family: var(--font-title);
    font-size: 0.75rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 3px;
}

/* Status lines: the narrator's ledger, not the story. Small diamond marker,
   UI face, and the colour carries the kind (success/stat/status). */
.narrative-line {
    font-family: var(--font-ui);
    border-left: 0;
    padding: 5px 10px 5px 22px;
    position: relative;
}
.narrative-line::before {
    content: "";
    position: absolute;
    left: 7px; top: 0.95em;
    width: 5px; height: 5px;
    transform: rotate(45deg);
    background: currentColor;
    opacity: 0.55;
}
.narrative-line.scene-prose { font-family: var(--font-prose); padding-left: 22px; }
.narrative-line.scene-prose::before { background: var(--frost); opacity: 0.5; }
.stat-change { color: #9fe6d6; }
.success-log { color: var(--gold); }

/* --- Round title ------------------------------------------------------------ */
#roundTitle { font-size: clamp(18px, 1.5vw, 22px); letter-spacing: 0.03em; }

/* --- Action groups: one accent per kind ------------------------------------- */
.action-box-group {
    --kind: var(--frost);
    --kind-rgb: 95, 224, 220;
    position: relative;
    padding: 14px 16px 16px;
    border-radius: 14px;
}
.action-box-group[data-kind="intimate"] { --kind: #f39ab4; --kind-rgb: 243, 154, 180; }
.action-box-group[data-kind="tells"]    { --kind: var(--gold); --kind-rgb: 244, 199, 94; }
.action-box-group[data-kind="trio"]     { --kind: #ff9f6b; --kind-rgb: 255, 159, 107; }

.action-box-group::before {
    content: "";
    position: absolute;
    left: 16px; right: 16px; top: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(var(--kind-rgb), 0.7), transparent);
}
.action-box-title {
    color: var(--kind, var(--frost));
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.action-box-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(var(--kind-rgb, 95, 224, 220), 0.35), transparent);
}

.action-box-group .action-btn {
    font-family: var(--font-ui);
    font-weight: 500;
    letter-spacing: 0.01em;
    padding: 9px 14px;
    border-radius: 999px;
    color: #eef7f5;
    background: linear-gradient(180deg, rgba(var(--kind-rgb), 0.10), rgba(var(--kind-rgb), 0.03));
    border: 1px solid rgba(var(--kind-rgb), 0.26);
}
.action-box-group .action-btn:hover:not(:disabled) {
    color: #fff;
    background: linear-gradient(180deg, rgba(var(--kind-rgb), 0.24), rgba(var(--kind-rgb), 0.08));
    border-color: rgba(var(--kind-rgb), 0.85);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3), 0 0 18px rgba(var(--kind-rgb), 0.22);
}
.action-box-group .action-btn.is-locked {
    opacity: 1;
    color: rgba(238, 247, 245, 0.42);
    background: rgba(255, 255, 255, 0.015);
    border-style: dashed;
    border-color: rgba(var(--kind-rgb), 0.18);
}
.action-box-group .action-btn.is-locked .req-badge { color: rgba(255, 180, 160, 0.75); }

.req-badge {
    font-family: var(--font-ui);
    font-weight: 600;
    font-size: 0.6875rem;
    letter-spacing: 0.02em;
    margin-left: 8px;
    padding: 1px 7px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.25);
}
.req-badge.req-ok { color: var(--gold); border-color: rgba(244, 199, 94, 0.35); }
/* A requirement of nothing is noise on fourteen buttons at once. */
.req-badge.req-zero { display: none; }

/* --- Choice cards (cut in / let it happen, landings, confrontations) -------- */
.finish-choice-box,
.landfall-box {
    background:
        linear-gradient(180deg, rgba(244, 199, 94, 0.06), transparent 50%),
        rgba(4, 22, 32, 0.6);
    border: 1px solid var(--hairline);
    border-radius: 14px;
    box-shadow: inset 0 -40px 50px -40px rgba(25, 184, 191, 0.18);
}
.landfall-opt,
.confront-opt {
    position: relative;
    padding: 13px 44px 13px 18px !important;
    border-radius: 10px !important;
    background: linear-gradient(90deg, rgba(244, 199, 94, 0.07), rgba(25, 184, 191, 0.04)) !important;
    border: 1px solid rgba(244, 199, 94, 0.2) !important;
    transition: border-color 0.2s, background 0.2s, transform 0.2s var(--ease-pop) !important;
}
.landfall-opt::after,
.confront-opt::after {
    content: "";
    position: absolute;
    right: 18px; top: 50%;
    width: 8px; height: 8px;
    border-top: 2px solid var(--gold);
    border-right: 2px solid var(--gold);
    transform: translateY(-50%) rotate(45deg);
    opacity: 0.45;
    transition: opacity 0.2s, right 0.2s;
}
.landfall-opt:hover:not(:disabled),
.confront-opt:hover:not(:disabled) {
    border-color: rgba(244, 199, 94, 0.65) !important;
    background: linear-gradient(90deg, rgba(244, 199, 94, 0.14), rgba(25, 184, 191, 0.08)) !important;
    transform: scale(1.02) !important;
}
.landfall-opt:hover:not(:disabled)::after,
.confront-opt:hover:not(:disabled)::after { opacity: 1; right: 14px; }
.landfall-opt .lf-lbl { font-family: var(--font-title); font-weight: 700; letter-spacing: 0.04em; color: var(--gold-hi); font-size: 0.95rem; }
.landfall-opt .lf-sub { font-size: 0.78rem; color: rgba(226, 252, 248, 0.6); }

/* --- Sway panel ------------------------------------------------------------- */
.sway-panel {
    background: linear-gradient(180deg, rgba(244, 199, 94, 0.07), rgba(244, 199, 94, 0.015));
    border-color: rgba(244, 199, 94, 0.25);
    border-radius: 14px;
}
.sway-title { font-family: var(--font-title); font-weight: 700; letter-spacing: 0.18em; }
.sway-btn {
    background: rgba(2, 16, 24, 0.55);
    border-color: rgba(244, 199, 94, 0.18);
    border-radius: 10px;
}
.sway-btn-label { font-family: var(--font-ui); font-weight: 600; }
.sway-btn-cost { color: var(--gold); opacity: 0.8; }

/* --- History log: a ship's log, not a terminal ------------------------------- */
#panelLog { max-width: 980px; }
.persistent-log-entry {
    font-family: var(--font-ui);
    font-size: 0.92rem;
    line-height: 1.55;
    color: #d5e3e1;
    position: relative;
    padding: 9px 12px 9px 108px;
    border-bottom: 1px solid rgba(244, 199, 94, 0.07);
    border-radius: 6px;
}
.persistent-log-entry:hover { background: rgba(25, 184, 191, 0.05); }
.log-timestamp {
    position: absolute;
    left: 12px; top: 10px;
    width: 82px;
    box-sizing: border-box;
    font-family: var(--font-ui);
    font-weight: 700;
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gold);
    text-align: center;
    padding: 1px 0;
    border: 1px solid rgba(244, 199, 94, 0.28);
    border-radius: 999px;
    background: rgba(244, 199, 94, 0.06);
    white-space: nowrap;
}

/* --- Settings: same ship as the rest ----------------------------------------- */
.settings-overlay { background: rgba(1, 10, 15, 0.72); backdrop-filter: blur(10px) saturate(1.1); }
.settings-card {
    position: relative;
    background:
        linear-gradient(180deg, rgba(244, 199, 94, 0.06), transparent 22%),
        linear-gradient(0deg, rgba(25, 184, 191, 0.08), transparent 30%),
        var(--card-bg-solid);
    border: 1px solid var(--hairline);
    box-shadow:
        inset 0 1px 0 rgba(255, 241, 189, 0.08),
        0 30px 90px rgba(0, 0, 0, 0.7),
        0 0 0 1px rgba(0, 0, 0, 0.4);
}
.settings-head { border-bottom: 1px solid var(--hairline); }
.settings-head h2 {
    font-family: var(--font-title);
    font-weight: 800;
    letter-spacing: 0.03em;
    background: var(--waterline);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.settings-group { border-bottom-color: rgba(244, 199, 94, 0.1); }
.settings-group h3 {
    font-family: var(--font-title);
    color: var(--gold);
    letter-spacing: 0.2em;
    display: flex; align-items: center; gap: 10px;
}
.settings-group h3::before {
    content: "";
    width: 7px; height: 7px;
    transform: rotate(45deg);
    background: linear-gradient(135deg, var(--gold-hi), var(--sea));
}
.settings-label-text { font-family: var(--font-ui); font-weight: 500; }
.settings-close { border-color: var(--hairline); color: var(--gold); }
.settings-close:hover { background: rgba(244, 199, 94, 0.1); color: var(--gold-hi); }
.settings-switch.is-on .switch-track { background: linear-gradient(90deg, var(--sea), var(--frost)); }
.settings-slider input[type="range"] { accent-color: var(--gold); }
.settings-foot { border-top: 1px solid var(--hairline); }
.settings-btn { font-family: var(--font-ui); border-radius: 999px; }
.settings-btn.primary {
    background: linear-gradient(180deg, #fff2c2 0%, #f7cd66 40%, #e1a336 100%);
    border-color: rgba(255, 235, 170, 0.8);
    color: #1b1204;
    box-shadow: 0 6px 20px rgba(242, 184, 75, 0.25);
}
.settings-btn.primary:hover { background: linear-gradient(180deg, #fff6d6 0%, #fad77d 40%, #eab14a 100%); }
.settings-segmented button[aria-pressed="true"],
.settings-segmented .is-on {
    background: linear-gradient(180deg, rgba(244, 199, 94, 0.25), rgba(244, 199, 94, 0.1));
    color: var(--gold-hi);
}

/* --- The Locker ---------------------------------------------------------------- */
.lk-card {
    background:
        linear-gradient(180deg, rgba(244, 199, 94, 0.04), transparent 45%),
        rgba(4, 22, 32, 0.62);
    border-color: rgba(244, 199, 94, 0.14);
    box-shadow: inset 0 -36px 44px -36px rgba(25, 184, 191, 0.22), 0 10px 26px rgba(0, 0, 0, 0.3);
}
.lk-card.is-ready:hover { border-color: rgba(244, 199, 94, 0.5); }
.lk-name { font-family: var(--font-title); font-weight: 700; letter-spacing: 0.02em; color: var(--gold-hi); }
.lk-section h3 { font-family: var(--font-title); color: var(--gold); letter-spacing: 0.06em; }
.lk-band-head { color: var(--frost); }
.lk-claim {
    font-family: var(--font-ui);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 0.78rem;
    border-radius: 999px;
    color: #1b1204;
    border: 1px solid rgba(255, 235, 170, 0.7);
    background: linear-gradient(180deg, #fff2c2 0%, #f7cd66 40%, #d99a2b 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 4px 14px rgba(242, 184, 75, 0.2);
}

/* --- Setup and prologue: the boat behind the paper ------------------------------ */
#setupModal {
    background:
        radial-gradient(ellipse 80% 60% at 50% 40%, rgba(2, 12, 18, 0.55), rgba(1, 6, 10, 0.92)),
        url("../data/video/deck.jpg") center / cover no-repeat,
        #020c13;
}
.setup-beat:first-child::first-letter { font-family: var(--font-title); }

/* --- Header: the two rows read as one instrument panel ---------------------------- */
.stat-pill { font-family: var(--font-ui); }
/* Numbers stay in the UI face: in Cinzel a 1 reads as I and a 0 as O. */
.stat-pill .stat-val,
.vday b, .vday strong { font-family: var(--font-ui); font-weight: 700; }

/* --- Sidebar names in the title face ------------------------------------------- */
.player-name-lbl { font-family: var(--font-title); font-weight: 700; letter-spacing: 0.03em; }

/* Status lines are the ledger, so they speak quieter than the story: medium
   weight, and only the names inside them are bright. */
.narrative-line.status-log,
.narrative-line.success-log,
.narrative-line.stat-change,
.persistent-log-entry { font-weight: 400; }
.narrative-line.status-log { color: rgba(255, 227, 163, 0.82); }
.narrative-line.status-log strong { color: var(--gold-hi); font-weight: 600; }
.narrative-line.success-log { color: rgba(244, 199, 94, 0.9); }
.persistent-log-entry strong { color: var(--gold-hi); font-weight: 600; }
.persistent-log-entry.status-log { color: #e6dcc0; }
.intro-banner p { max-width: 78ch; }

/* --- Window frame that stays put -------------------------------------------
   The modal cards scroll themselves (overflow-y: auto), and an absolutely
   placed ::before/::after inside a scroller only covers its first screenful:
   on a long card (the dossier) the gold corners and the gradient rim stopped
   halfway down and sat on top of the text. Element backgrounds do not scroll
   with the content, so the frame now lives there: the corners as four
   background layers, the rim as a border-box gradient behind a transparent
   border. */
:root {
    --ht-corners:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='34' height='34'%3E%3Cpath d='M2 22V6a4 4 0 0 1 4-4h16' fill='none' stroke='%23f4c75e' stroke-opacity='.75' stroke-width='1.3'/%3E%3Cpath d='M7 15c0-4.4 3.6-8 8-8' fill='none' stroke='%235fe0dc' stroke-opacity='.7' stroke-width='1.1'/%3E%3Ccircle cx='6' cy='6' r='1.6' fill='%23f4c75e'/%3E%3C/svg%3E") top 8px left 8px / 34px no-repeat,
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='34' height='34'%3E%3Cg transform='translate(34 0) scale(-1 1)'%3E%3Cpath d='M2 22V6a4 4 0 0 1 4-4h16' fill='none' stroke='%23f4c75e' stroke-opacity='.75' stroke-width='1.3'/%3E%3Cpath d='M7 15c0-4.4 3.6-8 8-8' fill='none' stroke='%235fe0dc' stroke-opacity='.7' stroke-width='1.1'/%3E%3Ccircle cx='6' cy='6' r='1.6' fill='%23f4c75e'/%3E%3C/g%3E%3C/svg%3E") top 8px right 8px / 34px no-repeat,
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='34' height='34'%3E%3Cg transform='translate(0 34) scale(1 -1)'%3E%3Cpath d='M2 22V6a4 4 0 0 1 4-4h16' fill='none' stroke='%23f4c75e' stroke-opacity='.75' stroke-width='1.3'/%3E%3Cpath d='M7 15c0-4.4 3.6-8 8-8' fill='none' stroke='%235fe0dc' stroke-opacity='.7' stroke-width='1.1'/%3E%3Ccircle cx='6' cy='6' r='1.6' fill='%23f4c75e'/%3E%3C/g%3E%3C/svg%3E") bottom 8px left 8px / 34px no-repeat,
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='34' height='34'%3E%3Cg transform='translate(34 34) scale(-1 -1)'%3E%3Cpath d='M2 22V6a4 4 0 0 1 4-4h16' fill='none' stroke='%23f4c75e' stroke-opacity='.75' stroke-width='1.3'/%3E%3Cpath d='M7 15c0-4.4 3.6-8 8-8' fill='none' stroke='%235fe0dc' stroke-opacity='.7' stroke-width='1.1'/%3E%3Ccircle cx='6' cy='6' r='1.6' fill='%23f4c75e'/%3E%3C/g%3E%3C/svg%3E") bottom 8px right 8px / 34px no-repeat;
    --ht-rim: linear-gradient(160deg, rgba(255, 241, 189, 0.75), rgba(244, 199, 94, 0.55) 18%, rgba(244, 199, 94, 0.12) 40%, rgba(25, 184, 191, 0.12) 62%, rgba(25, 184, 191, 0.6) 85%, rgba(95, 224, 220, 0.75)) border-box;
}
.modal-card::before,
.modal-card::after { display: none; }
.modal-card {
    border: 1px solid transparent;
    background:
        var(--ht-corners),
        linear-gradient(180deg, rgba(244, 199, 94, 0.05), transparent 30%) padding-box,
        linear-gradient(var(--card-bg-solid), var(--card-bg-solid)) padding-box,
        linear-gradient(#020c13, #020c13) padding-box,
        var(--ht-rim);
}
#endingModal .modal-card,
#epilogueModal .modal-card {
    background:
        var(--ht-corners),
        radial-gradient(ellipse 80% 40% at 50% 0%, rgba(244, 199, 94, 0.10), transparent 70%) padding-box,
        radial-gradient(ellipse 90% 40% at 50% 100%, rgba(25, 184, 191, 0.14), transparent 70%) padding-box,
        linear-gradient(var(--card-bg-solid), var(--card-bg-solid)) padding-box,
        linear-gradient(#020c13, #020c13) padding-box,
        var(--ht-rim);
}

/* The bowl overlay is centred on the arena panel, which is nearly empty while
   a ticket is being drawn: give it room so the chalice and its caption sit
   inside the panel instead of hanging off its bottom edge. */
body.is-drawing .arena-section { min-height: 640px; }

/* The gold plaque buttons speak in the title face, like the main menu. */
.btn-harem { font-family: var(--font-title); font-weight: 700; }
.log-timestamp { font-style: normal; }

/* ==========================================================================
   Main menu, take 3 (24-10-2026): a real sea in every plaque
   ==========================================================================
   Three wave bands per button (front layer listed first), light turquoise far away, sea-green in the
   middle and deep navy up front with a foam line, each rolling at its own
   speed (parallax). The tiles are 160/110/90 px and the loop moves each by a
   whole number of tiles, so it never jumps. Hover: the sea rises and rolls
   faster. Motion off: the sea stands still. */
.title-menu-btn {
    border-radius: 16px;
    padding-bottom: 32px;
}
.title-menu-btn::before {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 26px;
    z-index: -1;
    opacity: 1;
    border-radius: 0 0 15px 15px;
    transform: none;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='40' viewBox='0 0 90 40' preserveAspectRatio='none'%3E%3Cpath d='M0 25 Q22.5 20 45.0 25 T90 25 V40 H0Z' fill='%230c5f70' fill-opacity='1'/%3E%3Cpath d='M0 25 Q22.5 20 45.0 25 T90 25' fill='none' stroke='%23bff7f2' stroke-opacity='0.85' stroke-width='1.3'/%3E%3C/svg%3E") 0 100% / 90px 100% repeat-x,
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='110' height='40' viewBox='0 0 110 40' preserveAspectRatio='none'%3E%3Cpath d='M0 17 Q27.5 11 55.0 17 T110 17 V40 H0Z' fill='%2322b8c2' fill-opacity='0.85'/%3E%3Cpath d='M0 17 Q27.5 11 55.0 17 T110 17' fill='none' stroke='%237fe9e4' stroke-opacity='0.6' stroke-width='1'/%3E%3C/svg%3E") 0 100% / 110px 100% repeat-x,
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='40' viewBox='0 0 160 40' preserveAspectRatio='none'%3E%3Cpath d='M0 9 Q40.0 2 80.0 9 T160 9 V40 H0Z' fill='%23a6f4ef' fill-opacity='0.5'/%3E%3Cpath d='M0 9 Q40.0 2 80.0 9 T160 9' fill='none' stroke='%23d8fffb' stroke-opacity='0.55' stroke-width='1'/%3E%3C/svg%3E") 0 100% / 160px 100% repeat-x;
    animation: menuSea 14s linear infinite;
    transition: height 0.55s var(--ease-smooth);
    /* The wave tiles touch the bottom edge; while they roll at a fractional
       screen scale the GPU wraps that teal bottom row onto the top row, which
       drew a blue line across the plaque. The top few px are always clear sky,
       so clip them off. */
    clip-path: inset(2px 0 0 0);
}
.title-menu-btn.is-primary { padding-bottom: 38px; }
.title-menu-btn.is-primary::before {
    opacity: 1;
    transform: none;
    height: 30px;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='40' viewBox='0 0 90 40' preserveAspectRatio='none'%3E%3Cpath d='M0 25 Q22.5 20 45.0 25 T90 25 V40 H0Z' fill='%230b6472' fill-opacity='1'/%3E%3Cpath d='M0 25 Q22.5 20 45.0 25 T90 25' fill='none' stroke='%23ffffff' stroke-opacity='0.9' stroke-width='1.4'/%3E%3C/svg%3E") 0 100% / 90px 100% repeat-x,
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='110' height='40' viewBox='0 0 110 40' preserveAspectRatio='none'%3E%3Cpath d='M0 17 Q27.5 11 55.0 17 T110 17 V40 H0Z' fill='%2322b6c0' fill-opacity='0.92'/%3E%3Cpath d='M0 17 Q27.5 11 55.0 17 T110 17' fill='none' stroke='%23b6fbf6' stroke-opacity='0.8' stroke-width='1'/%3E%3C/svg%3E") 0 100% / 110px 100% repeat-x,
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='40' viewBox='0 0 160 40' preserveAspectRatio='none'%3E%3Cpath d='M0 9 Q40.0 2 80.0 9 T160 9 V40 H0Z' fill='%23a9f7f1' fill-opacity='0.75'/%3E%3Cpath d='M0 9 Q40.0 2 80.0 9 T160 9' fill='none' stroke='%23ffffff' stroke-opacity='0.7' stroke-width='1'/%3E%3C/svg%3E") 0 100% / 160px 100% repeat-x;
}
@keyframes menuSea {
    from { background-position: 0 100%, 0 100%, 0 100%; }
    to   { background-position: 450px 100%, -440px 100%, 320px 100%; }
}
.title-menu-btn:hover:not(:disabled)::before,
.title-menu-btn:focus-visible::before,
.title-menu-btn.is-primary:hover::before,
.title-menu-btn.is-primary:focus-visible::before {
    opacity: 1;
    transform: none;
    height: 38px;
    /* No filter here: a filtered layer at a fractional screen scale (125 %)
       leaves a 1px seam across the plaque at the top of the sea. */
    animation: menuSea 6s linear infinite;
}

/* Secondary plaques: deep night water above the waves, a lighter sheen at the
   top, so the band of blues reads from pale to dark top-to-bottom. */
.title-menu-btn:not(.is-primary) {
    background:
        radial-gradient(ellipse 70% 60% at 50% 0%, rgba(95, 224, 220, 0.16), transparent 70%),
        linear-gradient(180deg, rgba(10, 52, 68, 0.88) 0%, rgba(5, 30, 44, 0.9) 55%, rgba(3, 18, 28, 0.94) 100%);
    border-color: rgba(127, 233, 228, 0.32);
    box-shadow:
        inset 0 1px 0 rgba(191, 247, 242, 0.18),
        0 10px 30px rgba(0, 0, 0, 0.42),
        0 0 22px rgba(25, 184, 191, 0.12);
}
.title-menu-btn:not(.is-primary):hover:not(:disabled),
.title-menu-btn:not(.is-primary):focus-visible {
    border-color: rgba(143, 240, 234, 0.85);
    box-shadow:
        inset 0 1px 0 rgba(191, 247, 242, 0.25),
        0 14px 36px rgba(0, 0, 0, 0.5),
        0 0 34px rgba(25, 184, 191, 0.38);
}
.title-menu-btn:not(.is-primary) .tm-label {
    background: linear-gradient(180deg, #fff6d8 0%, #f4c75e 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
#titleScreen.has-video .title-menu-btn:not(.is-primary) .tm-label { text-shadow: none; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.8)); }
.title-menu-btn:not(.is-primary) .tm-meta { color: rgba(207, 247, 243, 0.75); }
/* No light sweep on the dark plaques: on hover it read as a pale box. */
.title-menu-btn:not(.is-primary)::after { display: none; }

/* The gold plaque: richer leaf, and a glint that crosses it now and then. */
.title-menu-btn.is-primary {
    background:
        radial-gradient(ellipse 60% 50% at 50% 0%, rgba(255, 255, 255, 0.55), transparent 70%),
        linear-gradient(180deg, #fff5cf 0%, #fbd977 28%, #eab347 58%, #c88a26 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        inset 0 -1px 0 rgba(0, 0, 0, 0.25),
        0 12px 34px rgba(0, 0, 0, 0.45),
        0 0 44px rgba(244, 199, 94, 0.32),
        0 0 70px rgba(25, 184, 191, 0.14);
}
.title-menu-btn.is-primary::after { animation: plaqueShine 1.1s ease-out 1.2s, menuGlint 7s ease-in-out 3s infinite; }
@keyframes menuGlint {
    0%, 82% { left: -60%; }
    100%    { left: 130%; }
}

/* Continue with no save: still water, greyed. */
.title-menu-btn:disabled::before { animation: none; filter: grayscale(0.7) brightness(0.7); }
.title-menu-btn:disabled .tm-label { -webkit-text-fill-color: rgba(220, 230, 228, 0.55); }

html[data-motion="reduced"] .title-menu-btn::before,
html[data-motion="none"] .title-menu-btn::before,
html[data-motion="none"] .title-menu-btn.is-primary::after { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
    .title-menu-btn::before, .title-menu-btn.is-primary::after { animation: none !important; }
}

/* ==========================================================================
   The sea everywhere (24-10-2026)
   ==========================================================================
   The main menu's three-band sea, made into a kit and carried through the
   game. Band tiles are 45/55/80 px wide (half the menu's, same shape at half height) and every loop moves each layer by
   whole tiles, so nothing jumps. Front band listed first.
     --sea-gold-*   bands for gold buttons (bright turquoise, white foam)
     --sea-night-*  bands for dark buttons, the masthead and the tab marker
     --sea-rule-*   three wave LINES, dark / mid / light: the new divider
   The tiles are plain URL-encoded SVG: colours are the fill/stroke values.
   ========================================================================== */
:root {
    --sea-gold-1: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='40' viewBox='0 0 90 40' preserveAspectRatio='none'%3E%3Cpath d='M0 25 Q22.5 20 45.0 25 T90 25 V40 H0Z' fill='%230b6472' fill-opacity='1'/%3E%3Cpath d='M0 25 Q22.5 20 45.0 25 T90 25' fill='none' stroke='%23ffffff' stroke-opacity='0.9' stroke-width='1.3' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
    --sea-gold-2: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='110' height='40' viewBox='0 0 110 40' preserveAspectRatio='none'%3E%3Cpath d='M0 17 Q27.5 11 55.0 17 T110 17 V40 H0Z' fill='%2322b6c0' fill-opacity='0.92'/%3E%3Cpath d='M0 17 Q27.5 11 55.0 17 T110 17' fill='none' stroke='%23b6fbf6' stroke-opacity='0.8' stroke-width='1' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
    --sea-gold-3: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='40' viewBox='0 0 160 40' preserveAspectRatio='none'%3E%3Cpath d='M0 9 Q40.0 2 80.0 9 T160 9 V40 H0Z' fill='%23a9f7f1' fill-opacity='0.75'/%3E%3Cpath d='M0 9 Q40.0 2 80.0 9 T160 9' fill='none' stroke='%23ffffff' stroke-opacity='0.7' stroke-width='1' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
    --sea-night-1: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='40' viewBox='0 0 90 40' preserveAspectRatio='none'%3E%3Cpath d='M0 25 Q22.5 20 45.0 25 T90 25 V40 H0Z' fill='%230c5f70' fill-opacity='1'/%3E%3Cpath d='M0 25 Q22.5 20 45.0 25 T90 25' fill='none' stroke='%23bff7f2' stroke-opacity='0.85' stroke-width='1.2' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
    --sea-night-2: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='110' height='40' viewBox='0 0 110 40' preserveAspectRatio='none'%3E%3Cpath d='M0 17 Q27.5 11 55.0 17 T110 17 V40 H0Z' fill='%2322b8c2' fill-opacity='0.8'/%3E%3Cpath d='M0 17 Q27.5 11 55.0 17 T110 17' fill='none' stroke='%237fe9e4' stroke-opacity='0.6' stroke-width='1' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
    --sea-night-3: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='40' viewBox='0 0 160 40' preserveAspectRatio='none'%3E%3Cpath d='M0 9 Q40.0 2 80.0 9 T160 9 V40 H0Z' fill='%23a6f4ef' fill-opacity='0.45'/%3E%3Cpath d='M0 9 Q40.0 2 80.0 9 T160 9' fill='none' stroke='%23d8fffb' stroke-opacity='0.5' stroke-width='1' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
    --sea-rule-1: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='14' viewBox='0 0 90 14' preserveAspectRatio='none'%3E%3Cpath d='M0 9 Q22.5 6 45.0 9 T90 9' fill='none' stroke='%230f7d8a' stroke-opacity='0.95' stroke-width='1.6' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
    --sea-rule-2: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='110' height='14' viewBox='0 0 110 14' preserveAspectRatio='none'%3E%3Cpath d='M0 7 Q27.5 4 55.0 7 T110 7' fill='none' stroke='%232cc3cc' stroke-opacity='0.85' stroke-width='1.3' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
    --sea-rule-3: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='14' viewBox='0 0 160 14' preserveAspectRatio='none'%3E%3Cpath d='M0 5 Q40.0 2 80.0 5 T160 5' fill='none' stroke='%23b6f6f1' stroke-opacity='0.7' stroke-width='1' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
    --gold-leaf: linear-gradient(180deg, #fff5cf 0%, #fbd977 30%, #eab347 62%, #c88a26 100%);
}
@keyframes seaRoll {
    from { background-position: 0 100%, 0 100%, 0 100%, 0 0; }
    to   { background-position: 450px 100%, -440px 100%, 320px 100%, 0 0; }
}
@keyframes seaRollBare {
    from { background-position: 0 100%, 0 100%, 0 100%; }
    to   { background-position: 450px 100%, -440px 100%, 320px 100%; }
}
@keyframes ruleRoll {
    from { background-position: 0 50%, 0 50%, 0 50%; }
    to   { background-position: -450px 50%, 440px 50%, -320px 50%; }
}

/* --- Masthead: a living strip of sea instead of a thin blue squiggle ------ */
header::after {
    content: "";
    position: absolute;
    left: 0; right: 0;
    bottom: -10px;
    height: 18px;
    z-index: 3;
    opacity: 1;
    pointer-events: none;
    background: var(--sea-night-1) 0 100% / 45px 100% repeat-x,
                var(--sea-night-2) 0 100% / 55px 100% repeat-x,
                var(--sea-night-3) 0 100% / 80px 100% repeat-x;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.45));
    animation: seaRollBare 40s linear infinite;
}

/* --- Dividers: three wave lines in three blues ----------------------------- */
.modal-card h2::after {
    width: 180px;
    height: 14px;
    margin: 12px auto 0;
    background: var(--sea-rule-1) 0 50% / 90px 100% repeat-x,
                var(--sea-rule-2) 0 50% / 110px 100% repeat-x,
                var(--sea-rule-3) 0 50% / 160px 100% repeat-x;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 25%, #000 75%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 25%, #000 75%, transparent);
    animation: ruleRoll 30s linear infinite;
}
.settings-head h2::after {
    content: "";
    display: block;
    width: 220px;
    height: 14px;
    margin-top: 10px;
    background: var(--sea-rule-1) 0 50% / 90px 100% repeat-x,
                var(--sea-rule-2) 0 50% / 110px 100% repeat-x,
                var(--sea-rule-3) 0 50% / 160px 100% repeat-x;
    -webkit-mask-image: linear-gradient(90deg, #000 60%, transparent);
    mask-image: linear-gradient(90deg, #000 60%, transparent);
    animation: ruleRoll 30s linear infinite;
}
.title-byline::before,
.title-byline::after {
    width: 64px;
    height: 12px;
    background: var(--sea-rule-1) 0 50% / 90px 100% repeat-x,
                var(--sea-rule-2) 0 50% / 110px 100% repeat-x,
                var(--sea-rule-3) 0 50% / 160px 100% repeat-x;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 60%);
    mask-image: linear-gradient(90deg, transparent, #000 60%);
    animation: ruleRoll 30s linear infinite;
}
.title-byline::after { transform: scaleX(-1); }

/* Section titles in the arena and the Locker trail the same rule. */
.action-box-title::after,
.lk-band-head::after {
    height: 12px;
    background: var(--sea-rule-1) 0 50% / 90px 100% repeat-x,
                var(--sea-rule-2) 0 50% / 110px 100% repeat-x,
                var(--sea-rule-3) 0 50% / 160px 100% repeat-x;
    -webkit-mask-image: linear-gradient(90deg, #000, transparent);
    mask-image: linear-gradient(90deg, #000, transparent);
    opacity: 0.8;
}

/* --- Tabs: the active tab rides on a small sea, not a bar ------------------- */
.tabs-navigation { border-bottom-color: rgba(127, 233, 228, 0.14); }
.tab-slider {
    height: 10px;
    bottom: -1px;
    border-radius: 0;
    box-shadow: none;
    background: var(--sea-night-1) 0 100% / 45px 100% repeat-x,
                var(--sea-night-2) 0 100% / 55px 100% repeat-x,
                var(--sea-night-3) 0 100% / 80px 100% repeat-x;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
    filter: drop-shadow(0 0 6px rgba(25, 184, 191, 0.55));
    animation: seaRollBare 16s linear infinite;
}

/* --- Gold buttons: gold leaf with the three-band sea in its lower third ------ */
.btn-harem,
.btn-harem.nav-btn:hover:not(:disabled),
.lk-claim,
.lk-claim:hover:not(:disabled),
.settings-btn.primary,
.settings-btn.primary:hover {
    background: var(--sea-gold-1) 0 100% / 45px 18px repeat-x, var(--sea-gold-2) 0 100% / 55px 18px repeat-x, var(--sea-gold-3) 0 100% / 80px 18px repeat-x, var(--gold-leaf);
    background-color: #e9b246;
}
.btn-harem,
.lk-claim,
.settings-btn.primary {
    border: 1px solid rgba(255, 238, 180, 0.85);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        inset 0 -1px 0 rgba(0, 0, 0, 0.25),
        0 8px 24px rgba(0, 0, 0, 0.35),
        0 0 26px rgba(244, 199, 94, 0.22);
}
.btn-harem:hover:not(:disabled),
.lk-claim:hover:not(:disabled),
.settings-btn.primary:hover {
    animation: seaRoll 5s linear infinite;
    filter: brightness(1.06) saturate(1.1);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        0 10px 30px rgba(0, 0, 0, 0.4),
        0 0 36px rgba(244, 199, 94, 0.4),
        0 0 22px rgba(25, 184, 191, 0.35);
}

/* --- Night buttons: dark water, a hairline, the sea along the bottom -------- */
.nav-btn:not(.btn-harem),
.sway-btn,
.settings-btn:not(.primary),
.landfall-opt,
.confront-opt,
.title-link {
    background: var(--sea-night-1) 0 100% / 45px 13px repeat-x, var(--sea-night-2) 0 100% / 55px 13px repeat-x, var(--sea-night-3) 0 100% / 80px 13px repeat-x,
        linear-gradient(180deg, rgba(12, 54, 70, 0.75), rgba(3, 20, 30, 0.9)) !important;
    background-color: rgba(3, 20, 30, 0.9) !important;
}
.nav-btn:not(.btn-harem):hover:not(:disabled),
.sway-btn:hover:not(:disabled),
.settings-btn:not(.primary):hover,
.landfall-opt:hover:not(:disabled),
.confront-opt:hover:not(:disabled),
.title-link:hover,
.title-link:focus-visible {
    background: var(--sea-night-1) 0 100% / 45px 20px repeat-x, var(--sea-night-2) 0 100% / 55px 20px repeat-x, var(--sea-night-3) 0 100% / 80px 20px repeat-x,
        linear-gradient(180deg, rgba(16, 70, 88, 0.85), rgba(4, 26, 38, 0.92)) !important;
    animation: seaRoll 7s linear infinite;
    border-color: rgba(143, 240, 234, 0.7) !important;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35), 0 0 22px rgba(25, 184, 191, 0.28);
}
.sway-btn, .landfall-opt, .confront-opt { padding-bottom: 16px !important; }
/* Short gold buttons: lift the label clear of the water. */
.lk-claim { padding-top: 7px; padding-bottom: 17px; }
.settings-btn.primary { padding-bottom: 16px; }
.btn-harem { padding-bottom: 15px !important; }
.title-link { padding-bottom: 11px; }
.sway-btn:disabled, .nav-btn:disabled { filter: grayscale(0.6); }

/* Action pills: the sea only comes up when you point at one. */
.action-box-group .action-btn:hover:not(:disabled) {
    background: var(--sea-night-1) 0 100% / 45px 12px repeat-x, var(--sea-night-2) 0 100% / 55px 12px repeat-x, var(--sea-night-3) 0 100% / 80px 12px repeat-x,
        linear-gradient(180deg, rgba(var(--kind-rgb), 0.24), rgba(var(--kind-rgb), 0.08));
    animation: seaRoll 6s linear infinite;
}

html[data-motion="reduced"] header::after,
html[data-motion="none"] header::after,
html[data-motion="reduced"] .tab-slider,
html[data-motion="none"] .tab-slider,
html[data-motion="none"] .modal-card h2::after,
html[data-motion="none"] .settings-head h2::after,
html[data-motion="none"] .title-byline::before,
html[data-motion="none"] .title-byline::after { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
    header::after, .tab-slider, .modal-card h2::after, .settings-head h2::after,
    .title-byline::before, .title-byline::after,
    .btn-harem, .lk-claim, .nav-btn, .sway-btn, .action-btn { animation: none !important; }
}

/* ==========================================================================
   The folded ticket (24-10-2026)
   ==========================================================================
   Before: two cream paper flaps with a pencil crease down the middle, which
   read as a beige box on top of the gold bowl. Now the slip is a night-sea
   letter: navy paper in a double gold frame, the three-band sea along its
   lower edge, and a gold-and-turquoise seal sitting across the fold. The seal
   breaks first, then the flaps open onto the name. */
.rt-flap {
    background:
        radial-gradient(ellipse 70% 90% at 50% 100%, rgba(95, 224, 220, 0.12), transparent 70%),
        linear-gradient(180deg, #0d3a4a 0%, #072636 55%, #041a26 100%);
    box-shadow:
        inset 0 0 0 1px rgba(244, 199, 94, 0.75),
        inset 0 0 0 4px #062330,
        inset 0 0 0 5px rgba(244, 199, 94, 0.35);
}
.rt-flap-top {
    z-index: 6;
    border-radius: 12px 12px 3px 3px;
    background:
        var(--sea-rule-1) 50% 42% / 90px 12px repeat-x,
        var(--sea-rule-2) 50% 42% / 110px 12px repeat-x,
        var(--sea-rule-3) 50% 42% / 160px 12px repeat-x,
        radial-gradient(ellipse 60% 80% at 50% 0%, rgba(244, 199, 94, 0.14), transparent 70%),
        linear-gradient(180deg, #0f4152 0%, #082a3a 60%, #062231 100%);
    box-shadow:
        inset 0 0 0 1px rgba(244, 199, 94, 0.75),
        inset 0 0 0 4px #062330,
        inset 0 0 0 5px rgba(244, 199, 94, 0.35),
        0 3px 8px rgba(0, 0, 0, 0.45);
}
.rt-flap-bottom {
    border-radius: 3px 3px 12px 12px;
    background:
        var(--sea-night-1) 0 100% / 45px 22px repeat-x,
        var(--sea-night-2) 0 100% / 55px 22px repeat-x,
        var(--sea-night-3) 0 100% / 80px 22px repeat-x,
        linear-gradient(180deg, #072636 0%, #052030 100%);
    animation: seaRollBare 9s linear infinite;
}
/* the old pencil crease */
.rt-flap-bottom::after { display: none; }

/* The seal across the fold: gold rim, turquoise wax, a wave stamped in it. */
/* It sits on the card, not on a flap: riding the top flap, it swung away
   half-clipped by the fold as the flap turned, which looked like a cut. */
.rt-flap-top::after { display: none; }
.rt-card::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    margin-top: -19px;
    width: 38px;
    height: 38px;
    margin-left: -19px;
    border-radius: 50%;
    z-index: 7;
    transform: translateZ(2px);
    pointer-events: none;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 13c2 0 2-1.6 3.5-1.6S10.5 13 12 13s2-1.6 3.5-1.6S17.5 13 19 13' fill='none' stroke='%23fff6d8' stroke-width='1.9' stroke-linecap='round'/%3E%3Cpath d='M7 16.4c1.7 0 1.7-1.2 2.9-1.2s1.4 1.2 2.1 1.2 1.4-1.2 2.6-1.2 1.2 1.2 2.4 1.2' fill='none' stroke='%23bff7f2' stroke-opacity='.7' stroke-width='1.2' stroke-linecap='round'/%3E%3C/svg%3E") center / 72% no-repeat,
        radial-gradient(circle at 35% 30%, #5fe6e0, #12939e 52%, #075460 100%);
    box-shadow:
        0 0 0 2px #f4c75e,
        0 0 0 3px rgba(120, 72, 10, 0.6),
        0 4px 10px rgba(0, 0, 0, 0.6),
        0 0 18px rgba(244, 199, 94, 0.55);
    animation: sealGlow 1.6s ease-in-out infinite;
    transition: transform 0.22s ease-in, opacity 0.22s ease-in;
}
@keyframes sealGlow {
    0%, 100% { box-shadow: 0 0 0 2px #f4c75e, 0 0 0 3px rgba(120, 72, 10, 0.6), 0 4px 10px rgba(0, 0, 0, 0.6), 0 0 12px rgba(244, 199, 94, 0.35); }
    50%      { box-shadow: 0 0 0 2px #fff1bd, 0 0 0 3px rgba(120, 72, 10, 0.6), 0 4px 10px rgba(0, 0, 0, 0.6), 0 0 24px rgba(95, 224, 220, 0.7); }
}
/* Opening: the seal bursts first, then the flaps swing open and fade out as
   they pass edge-on, so they never vanish mid-turn. */
.reveal-ticket.open .rt-card::after {
    animation: sealBreak 0.32s ease-out forwards;
}
@keyframes sealBreak {
    0%   { transform: translateZ(2px) scale(1);   opacity: 1; filter: brightness(1); }
    40%  { transform: translateZ(2px) scale(1.25); opacity: 1; filter: brightness(1.8); }
    100% { transform: translateZ(2px) scale(1.9);  opacity: 0; filter: brightness(2.2); }
}
.reveal-ticket.open .rt-flap-top,
.reveal-ticket.open .rt-flap-bottom {
    opacity: 0;
    transition: transform 0.6s cubic-bezier(.4, 0, .2, 1) 0.14s, opacity 0.3s ease 0.36s;
}
.reveal-ticket:not(.active) .rt-card::after { opacity: 0; }

/* The whole slip glows like the gold buttons while it is still folded. */
.reveal-ticket:not(.open) .rt-card { filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 16px rgba(25, 184, 191, 0.25)); }

html[data-motion="none"] .rt-flap-bottom,
html[data-motion="none"] .rt-card::after { animation: none !important; }

/* The fold itself: a gold seam where the two halves meet. */
.rt-flap-bottom::before {
    content: "";
    position: absolute;
    left: 8px; right: 8px; top: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 241, 189, 0.85), transparent);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}
html[data-motion="none"] .reveal-ticket.open .rt-card::after { opacity: 0; }

/* ==========================================================================
   Locker objects in 3D (24-10-2026)
   ==========================================================================
   Each cheat card shows its object turning on a little pool of sea light:
   a 24-frame strip rendered in Blender (tools/blender/locker_items.py,
   packed by locker_atlas.py), stepped through with steps(). Faster on hover,
   stopped and greyed while the cheat is resting, still with motion off. */
.lk-card { grid-template-columns: 96px 1fr; }
.lk-obj {
    position: relative;
    width: 96px;
    height: 96px;
    margin: -8px 0 -6px -6px;
}
.lk-obj > span { display: none; }
/* the object itself, above its glow */
.lk-obj::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: var(--sheet) 0 0 / 2304px 96px no-repeat;
    animation: lkSpin 4.2s steps(24) infinite;
    filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 14px rgba(244, 199, 94, 0.18));
    transition: filter 0.3s ease;
}
/* a pool of sea light under it */
.lk-obj::after {
    content: "";
    position: absolute;
    left: 14%; right: 14%; bottom: 2px;
    height: 16px;
    z-index: 0;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(95, 224, 220, 0.45), rgba(25, 184, 191, 0.12) 60%, transparent);
    filter: blur(2px);
}
@keyframes lkSpin { to { background-position: -2304px 0; } }

.lk-card.is-ready:hover .lk-obj::before {
    animation-duration: 1.8s;
    filter: drop-shadow(0 10px 12px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 22px rgba(244, 199, 94, 0.45));
}
.lk-card.is-cooling .lk-obj::before {
    animation-play-state: paused;
    filter: grayscale(0.75) brightness(0.7) drop-shadow(0 8px 10px rgba(0, 0, 0, 0.55));
}
html[data-motion="none"] .lk-obj::before,
html[data-motion="reduced"] .lk-obj::before { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .lk-obj::before { animation-play-state: paused; } }

/* ==========================================================================
   Ashore: the villa (PLAN-villa.md §3, haven-ui.js)
   ==========================================================================
   While the crew sleeps in the villa the game changes house: body.is-ashore
   swaps the three sea kits for sand and terracotta (same tiles, other inks),
   warms the panels a little and gives the two renamed tabs their icons. The
   semantic colours (characters, jealousy, pacts, danger) stay as they are.
   ========================================================================== */
body.is-ashore {
    --sea-gold-1: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='40' viewBox='0 0 90 40' preserveAspectRatio='none'%3E%3Cpath d='M0 25 Q22.5 20 45.0 25 T90 25 V40 H0Z' fill='%238a4f2b' fill-opacity='1'/%3E%3Cpath d='M0 25 Q22.5 20 45.0 25 T90 25' fill='none' stroke='%23ffffff' stroke-opacity='0.9' stroke-width='1.3' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
    --sea-gold-2: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='110' height='40' viewBox='0 0 110 40' preserveAspectRatio='none'%3E%3Cpath d='M0 17 Q27.5 11 55.0 17 T110 17 V40 H0Z' fill='%23c4834a' fill-opacity='0.92'/%3E%3Cpath d='M0 17 Q27.5 11 55.0 17 T110 17' fill='none' stroke='%23f7dcb0' stroke-opacity='0.8' stroke-width='1' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
    --sea-gold-3: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='40' viewBox='0 0 160 40' preserveAspectRatio='none'%3E%3Cpath d='M0 9 Q40.0 2 80.0 9 T160 9 V40 H0Z' fill='%23ead2a4' fill-opacity='0.75'/%3E%3Cpath d='M0 9 Q40.0 2 80.0 9 T160 9' fill='none' stroke='%23ffffff' stroke-opacity='0.7' stroke-width='1' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
    --sea-night-1: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='40' viewBox='0 0 90 40' preserveAspectRatio='none'%3E%3Cpath d='M0 25 Q22.5 20 45.0 25 T90 25 V40 H0Z' fill='%236e3f22' fill-opacity='1'/%3E%3Cpath d='M0 25 Q22.5 20 45.0 25 T90 25' fill='none' stroke='%23f3dcae' stroke-opacity='0.85' stroke-width='1.2' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
    --sea-night-2: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='110' height='40' viewBox='0 0 110 40' preserveAspectRatio='none'%3E%3Cpath d='M0 17 Q27.5 11 55.0 17 T110 17 V40 H0Z' fill='%23b97a43' fill-opacity='0.8'/%3E%3Cpath d='M0 17 Q27.5 11 55.0 17 T110 17' fill='none' stroke='%23f0c98a' stroke-opacity='0.6' stroke-width='1' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
    --sea-night-3: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='40' viewBox='0 0 160 40' preserveAspectRatio='none'%3E%3Cpath d='M0 9 Q40.0 2 80.0 9 T160 9 V40 H0Z' fill='%23e6cc98' fill-opacity='0.45'/%3E%3Cpath d='M0 9 Q40.0 2 80.0 9 T160 9' fill='none' stroke='%23fff1d6' stroke-opacity='0.5' stroke-width='1' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
    --sea-rule-1: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='14' viewBox='0 0 90 14' preserveAspectRatio='none'%3E%3Cpath d='M0 9 Q22.5 6 45.0 9 T90 9' fill='none' stroke='%239a5a33' stroke-opacity='0.95' stroke-width='1.6' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
    --sea-rule-2: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='110' height='14' viewBox='0 0 110 14' preserveAspectRatio='none'%3E%3Cpath d='M0 7 Q27.5 4 55.0 7 T110 7' fill='none' stroke='%23cf9356' stroke-opacity='0.85' stroke-width='1.3' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
    --sea-rule-3: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='14' viewBox='0 0 160 14' preserveAspectRatio='none'%3E%3Cpath d='M0 5 Q40.0 2 80.0 5 T160 5' fill='none' stroke='%23f1d9ab' stroke-opacity='0.7' stroke-width='1' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
    --bg-deep: #1d1209;
    --card-bg: rgba(38, 24, 14, 0.6);
    --card-bg-solid: rgba(28, 17, 9, 0.96);
    --border-glow: rgba(214, 150, 84, 0.3);
    --wine: #7a4424;
    --hairline: rgba(244, 199, 94, 0.26);
    --shadow-glow: 0 0 22px rgba(214, 150, 84, 0.12);
    background-image:
        radial-gradient(ellipse 70% 45% at 50% -8%, rgba(244, 199, 94, 0.13) 0%, transparent 70%),
        radial-gradient(ellipse 60% 50% at 8% 108%, rgba(201, 120, 64, 0.16) 0%, transparent 70%),
        radial-gradient(ellipse 60% 50% at 95% 100%, rgba(110, 63, 34, 0.22) 0%, transparent 70%),
        linear-gradient(180deg, #0d0805 0%, var(--bg-deep) 100%);
}
body.is-ashore .tabs-navigation { border-bottom-color: rgba(240, 201, 138, 0.18); }
body.is-ashore .tab-slider { filter: drop-shadow(0 0 6px rgba(214, 150, 84, 0.55)); }

/* The two tabs that changed house: an old key, and a palm. */
.tab-btn.is-land::before {
    content: "";
    display: inline-block;
    width: 1.05em;
    height: 1.05em;
    margin: 0 0.45em -0.14em 0;
    background: currentColor;
    -webkit-mask: var(--tab-icon) center / contain no-repeat;
    mask: var(--tab-icon) center / contain no-repeat;
}
#tabPlay.is-land { --tab-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 12a4 4 0 1 0 8 0a4 4 0 1 0-8 0M11 12h10M17 12v4M20.5 12v3' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E"); }
#tabSea.is-land  { --tab-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12.5 21.5c-.2-4.6.3-8.4 1.3-11.2' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M13.8 10.3C11.6 7.2 7.4 6.2 4 8.3c3.4-.3 6.8.6 9.8 2zM13.8 10.3c.8-3.6 4.7-5.5 8-4-3 .1-5.6 1.6-8 4zM13.8 10.3c-3.2-.7-7 1.3-8.1 4.6 2.2-2.3 5-3.6 8.1-4.6zM13.8 10.3c3.1-.3 6.4 1.9 6.9 5-1.9-2.1-4.3-3.7-6.9-5z' fill='%23000'/%3E%3Cpath d='M2.5 21.5h19' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); }

/* The wave that carries the change along the tab bar. */
.tab-tide-clip {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 4;
}
.tab-tide {
    position: absolute;
    top: 0; bottom: 0;
    left: 0;
    width: 46%;
    background:
        linear-gradient(90deg, transparent 0%, rgba(255, 248, 220, 0.0) 5%, rgba(255, 248, 220, 0.98) 16%,
                        rgba(244, 199, 94, 0.85) 28%, rgba(214, 150, 84, 0.55) 50%, rgba(150, 90, 50, 0.25) 75%, transparent 100%);
    animation: tabTideIn 1.5s cubic-bezier(0.45, 0.05, 0.4, 1) forwards;
}
.tab-tide.is-back {
    background:
        linear-gradient(270deg, transparent 0%, rgba(226, 252, 248, 0.0) 5%, rgba(226, 252, 248, 0.98) 16%,
                        rgba(95, 224, 220, 0.82) 28%, rgba(25, 184, 191, 0.55) 50%, rgba(11, 95, 110, 0.25) 75%, transparent 100%);
    animation-name: tabTideOut;
}
@keyframes tabTideIn  { from { transform: translateX(230%); } to { transform: translateX(-110%); } }
@keyframes tabTideOut { from { transform: translateX(-110%); } to { transform: translateX(230%); } }
.tab-btn.is-washed { animation: tabWash 0.8s ease; }
@keyframes tabWash {
    0%   { filter: none; opacity: 1; }
    30%  { filter: blur(3px) brightness(1.8); opacity: 0.25; }
    100% { filter: none; opacity: 1; }
}

/* The banner: "The Villa · night 1 of 3", "Back to sea · day 9". */
.haven-banner {
    position: fixed;
    inset: 0;
    z-index: 900;
    display: grid;
    place-items: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.9s ease;
}
.haven-banner.is-on { opacity: 1; transition-duration: 0.6s; }
.haven-banner .hb-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 54px 24px 46px;
    /* A cinema band across the screen: whatever is behind goes quiet. */
    background: linear-gradient(180deg, transparent 0%, rgba(8, 5, 2, 0.78) 22%, rgba(8, 5, 2, 0.9) 50%,
                                rgba(8, 5, 2, 0.78) 78%, transparent 100%);
    transform: translateY(8px) scale(0.98);
    transition: transform 1.2s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.haven-banner.is-on .hb-card { transform: none; }
.haven-banner b {
    font-family: 'Cinzel', serif;
    font-weight: 800;
    font-size: clamp(34px, 6vw, 72px);
    letter-spacing: 0.08em;
    line-height: 1;
    background: var(--gold-leaf);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--gold);
    filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.6)) drop-shadow(0 0 22px rgba(244, 199, 94, 0.35));
}
.haven-banner.is-depart b {
    background: var(--waterline);
    -webkit-background-clip: text;
    background-clip: text;
}
.haven-banner span {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: clamp(14px, 1.6vw, 20px);
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--amber-soft);
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
}
.haven-banner span::before,
.haven-banner span::after {
    content: "";
    display: inline-block;
    width: 48px;
    height: 1px;
    margin: 0 14px 0.3em;
    vertical-align: middle;
    background: linear-gradient(90deg, transparent, var(--gold));
}
.haven-banner span::after { transform: scaleX(-1); }
html[data-motion="none"] .haven-banner .hb-card,
html[data-motion="reduced"] .haven-banner .hb-card { transform: none; transition: none; }

/* --- The morning in the villa (PLAN-villa.md §6.1, day-ui.js) -------------- */
/* Candles: the nights left. One goes out every dawn. */
.villa-candles {
    display: inline-flex;
    gap: 7px;
    margin-left: 12px;
    vertical-align: middle;
}
.villa-candle {
    position: relative;
    display: inline-block;
    width: 7px;
    height: 16px;
    margin-top: 6px;
    border-radius: 2px 2px 1px 1px;
    background: linear-gradient(180deg, #f6ead2, #c9b48e);
    opacity: 0.45;
}
.villa-candle::before {
    content: "";
    position: absolute;
    left: 50%;
    top: -9px;
    width: 6px;
    height: 9px;
    margin-left: -3px;
    border-radius: 50% 50% 45% 45%;
    background: radial-gradient(ellipse at 50% 70%, #fff6cf 0%, #ffc04d 45%, rgba(255, 120, 30, 0) 75%);
    opacity: 0;
}
.villa-candle.is-lit { opacity: 1; }
.villa-candle.is-lit::before {
    opacity: 1;
    filter: drop-shadow(0 0 5px rgba(255, 176, 70, 0.9));
    animation: candleFlicker 2.4s ease-in-out infinite;
}
.villa-candle.is-lit:nth-child(2)::before { animation-delay: -0.8s; }
.villa-candle.is-lit:nth-child(3)::before { animation-delay: -1.5s; }
@keyframes candleFlicker {
    0%, 100% { transform: scale(1) rotate(-2deg); }
    30% { transform: scale(0.92, 1.08) rotate(3deg); }
    60% { transform: scale(1.06, 0.95) rotate(-1deg); }
}
html[data-motion="none"] .villa-candle::before,
html[data-motion="reduced"] .villa-candle::before { animation: none; }

/* The strip under the title: the house, the cistern, the boat. */
.villa-state {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1.4fr;
    gap: 6px;
    margin: 4px 0 2px;
}
.villa-state .vs-cell {
    padding: 6px 10px;
    border-radius: 9px;
    background: rgba(214, 150, 84, 0.07);
    border: 1px solid rgba(240, 201, 138, 0.16);
}
.villa-state small {
    display: block;
    font-family: 'Cinzel', serif;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(240, 201, 138, 0.75);
    margin-bottom: 2px;
}
.villa-state .vs-cell > div {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11.5px;
    color: var(--text-muted, #c9c2b0);
}
.villa-state svg { width: 15px; height: 15px; vertical-align: -3px; }
.villa-state b { color: var(--amber-soft); margin-left: 3px; font-size: 12.5px; }
.vs-res { display: inline-flex; align-items: center; }
.vs-res.is-gone { opacity: 0.35; }
.vs-boat { font-weight: 700; }
.vs-boat.is-safe { color: #8fd4a8; }
.vs-boat.is-open { color: #ffb347; }

/* Each post is a place on the island: its picture behind, darkened. */
.day-post.is-place {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    min-height: 74px;
    border-color: rgba(240, 201, 138, 0.18);
}
.day-post-bg {
    position: absolute;
    inset: 0;
    z-index: -2;
    background: center / cover no-repeat;
    transition: transform 0.6s ease;
}
.day-post.is-place::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, rgba(14, 9, 5, 0.18) 0%, rgba(14, 9, 5, 0.62) 45%, rgba(14, 9, 5, 0.86) 100%);
}
.day-post.is-place:hover .day-post-bg { transform: scale(1.06); }
.day-post.is-place .day-post-d { color: rgba(240, 228, 205, 0.85); }
.day-post.is-place .day-post-n { text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9); }
.day-post.is-place .day-post-head { padding-top: 22px; }
.day-post.is-place.is-manned { border-color: rgba(255, 217, 122, 0.45); }
.day-post.is-key {
    border-color: rgba(244, 199, 94, 0.55);
    box-shadow: 0 0 0 1px rgba(244, 199, 94, 0.18), 0 0 18px rgba(244, 199, 94, 0.12);
}
.day-post-tag {
    grid-column: 2;
    justify-self: start;
    margin-top: 3px;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 9.5px;
    font-weight: 700;
    color: #1b1204;
    background: var(--gold-leaf);
}
@media (max-width: 620px) {
    .villa-state { grid-template-columns: 1fr; }
}
/* In The Island's board the strip stacks, the panel is narrow. */
.villa-state.is-compact { grid-template-columns: 1fr; gap: 4px; margin: 6px 0; }
.villa-state.is-compact .vs-cell { padding: 4px 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.villa-state.is-compact small { margin: 0; }

/* --- The villa's two big questions (haven-ui.js, PLAN-villa.md §4.1 §7.1) -- */
.finish-choice-box.haven-choice {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    padding-top: 26px;
}
.haven-choice .hc-bg {
    position: absolute;
    inset: 0;
    z-index: -1;
    background: center 40% / cover no-repeat;
    opacity: 0.55;
    -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.55) 55%, rgba(0, 0, 0, 0.15) 100%);
    mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.55) 55%, rgba(0, 0, 0, 0.15) 100%);
}
.haven-choice h3 { font-family: 'Cinzel', serif; font-size: 1.25rem; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9); }
.haven-choice .lf-intro { text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9); }
.hc-faces { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.hc-face {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    overflow: hidden;
    display: inline-grid;
    place-items: center;
    font-style: normal;
    font-weight: 700;
    color: #1b1204;
    background: var(--c);
    border: 2px solid var(--c);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6), 0 3px 8px rgba(0, 0, 0, 0.5);
}
.hc-face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.haven-choice .haven-card,
.sea-proxy .haven-card {
    min-height: 92px;
    padding: 14px 16px;
    justify-content: center;
    gap: 4px;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(20, 13, 6, 0.72), rgba(10, 7, 4, 0.86));
    border: 1px solid rgba(240, 201, 138, 0.28);
    backdrop-filter: blur(2px);
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.haven-card .lf-lbl { font-family: 'Cinzel', serif; font-size: 17px; letter-spacing: 0.04em; }
.haven-card.is-go { border-color: rgba(244, 199, 94, 0.6); box-shadow: 0 0 0 1px rgba(244, 199, 94, 0.2), 0 8px 26px rgba(0, 0, 0, 0.45); }
.haven-card.is-go .lf-lbl { color: var(--gold); }
.haven-card:hover { transform: scale(1.02); border-color: rgba(255, 217, 122, 0.85); }
.haven-card .lf-note {
    margin-top: 4px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--amber-soft);
}
.haven-choice .landfall-opt.haven-card { display: flex; flex-direction: column; }
@media (min-width: 720px) {
    .haven-choice { display: grid; grid-template-columns: 1fr 1fr; column-gap: 10px; }
    .haven-choice > :not(.haven-card):not(.hc-bg) { grid-column: 1 / -1; }
}

/* --- The smoke (haven-ui.js decorateSmoke / decorateRescue): who would go,
   on each card; and the two of them, by their fire. -------------------- */
.haven-card .lf-faces { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 6px; min-height: 26px; }
.haven-card .lf-faces .hc-face { width: 26px; height: 26px; border-width: 1.5px; }
.haven-card .lf-faces .hc-face.is-small { width: 20px; height: 20px; margin-right: -4px; }
.hc-face.is-q {
    --c: rgba(244, 199, 94, 0.5);
    background: rgba(10, 7, 4, 0.6);
    border-style: dashed;
    color: var(--gold);
    font-family: 'Cinzel', serif;
}
.hc-face.is-q.is-maybe { opacity: 0.45; }
.haven-card:disabled { opacity: 0.45; transform: none; cursor: not-allowed; }
.haven-card:disabled .lf-faces { filter: grayscale(1); }
.haven-choice.is-smoke .haven-card { min-height: 84px; }
.hc-faces.is-cast { gap: 18px; justify-content: center; margin: 8px 0 14px; }
.hc-who { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.hc-who b { font-family: 'Cinzel', serif; font-size: 13px; letter-spacing: 0.08em; color: var(--gold); text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9); }
.hc-face.is-big {
    width: 62px;
    height: 62px;
    border-width: 2.5px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6), 0 0 22px rgba(255, 140, 60, 0.35), 0 6px 14px rgba(0, 0, 0, 0.55);
    animation: hc-rise 1.4s ease-out both;
}
.hc-who:nth-child(2) .hc-face.is-big { animation-delay: 0.35s; }
/* The raft (decorateRaft): open water instead of a picture, and her face with
   no name, asleep (grey, eyes nowhere), until she can say it. */
.haven-choice.is-raft .hc-bg {
    opacity: 0.9;
    background:
        radial-gradient(ellipse 60% 40% at 70% 30%, rgba(255, 214, 150, 0.22), transparent 70%),
        repeating-linear-gradient(176deg, rgba(255, 255, 255, 0.05) 0 2px, transparent 2px 18px),
        linear-gradient(180deg, #1d4a5c 0%, #0d2a37 55%, #06161e 100%);
}
.hc-face.is-nameless { --c: rgba(190, 205, 210, 0.55); background: #26343a; color: rgba(225, 235, 238, 0.85); font-family: 'Cinzel', serif; font-size: 26px; }
@keyframes hc-rise { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

/* --- The night in the villa, framed (haven-ui.js, PLAN-villa.md §6.2 §6.3) - */
.narrative-line.haven-beat {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    margin: 10px 0;
    padding: 46px 18px 16px;
    border-radius: 12px;
    border: 1px solid rgba(240, 201, 138, 0.3);
    background: rgba(12, 8, 4, 0.55);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
}
.haven-beat .hb-plate {
    position: absolute;
    inset: 0;
    z-index: -1;
    background: center / cover no-repeat;
    opacity: 0.5;
    -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.45) 60%, rgba(0, 0, 0, 0.2) 100%);
    mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.45) 60%, rgba(0, 0, 0, 0.2) 100%);
}
.haven-beat > small,
.haven-rumour > small {
    position: absolute;
    top: 14px;
    left: 18px;
    font-family: 'Cinzel', serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gold);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}
.haven-beat > span:last-child { display: block; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85); }
.narrative-line.haven-rumour {
    position: relative;
    margin: 10px 0;
    padding: 40px 16px 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 140, 120, 0.28);
    background: linear-gradient(180deg, rgba(60, 20, 18, 0.35), rgba(20, 10, 8, 0.35)),
                url("../data/video/islas/interior/amanecer-playa.jpg") center / cover no-repeat;
}
.haven-rumour > small { color: #ffc3a8; }
.haven-rumour > .narrative-line { margin: 4px 0; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9); }
/* A door left ajar, on what happened behind one. */
.haven-door {
    display: inline-block;
    width: 13px;
    height: 16px;
    margin: 0 8px -2px 0;
    border: 1.5px solid var(--amber-soft);
    border-radius: 1px;
    background: linear-gradient(90deg, rgba(255, 207, 92, 0.65) 0 22%, transparent 22%);
    transform: perspective(40px) rotateY(-28deg);
}
.narrative-line.haven-heard { color: var(--amber-soft); font-style: italic; opacity: 0.9; }

/* =====================================================================
   STORY MODE «El Selkie» (src/story.js, PLAN-historia.md)
   Full-screen cards (cold open, acts, the storm, arcs, the ending), the
   dawn title card, the logbook tab and the act line in the voyage strip.
   ===================================================================== */
.story-card {
    position: fixed; inset: 0; z-index: 9000;
    display: none; align-items: flex-end; justify-content: center;
    background: var(--bg-void);
    opacity: 0; transition: opacity 0.38s ease;
}
.story-card.is-in { opacity: 1; }
.story-card-img {
    position: absolute; inset: 0;
    background-size: cover; background-position: center;
    transform: scale(1.04);
    transition: transform 9s ease-out;
}
.story-card.is-in .story-card-img { transform: scale(1); }
.story-card-shade {
    position: absolute; inset: 0;
    background:
        linear-gradient(180deg, rgba(2, 12, 19, 0.15) 0%, rgba(2, 12, 19, 0.35) 45%, rgba(2, 12, 19, 0.92) 78%, rgba(2, 12, 19, 0.98) 100%);
}
.story-card-body {
    position: relative; z-index: 1;
    width: min(760px, calc(100% - 32px));
    margin: 0 auto 7vh;
    text-align: center;
    transform: translateY(12px); transition: transform 0.6s ease;
}
.story-card.is-in .story-card-body { transform: none; }
.story-card-kicker {
    font-family: var(--font-title); letter-spacing: 0.28em; text-transform: uppercase;
    font-size: 0.78rem; color: var(--frost); margin: 0 0 10px;
}
.story-card-title {
    font-family: var(--font-title); font-weight: 700;
    font-size: clamp(1.9rem, 4.6vw, 3.2rem); line-height: 1.08; margin: 0 0 16px;
    background: var(--gold-leaf, linear-gradient(180deg, #fff5cf, #eab347));
    -webkit-background-clip: text; background-clip: text; color: transparent;
    text-shadow: 0 2px 30px rgba(244, 199, 94, 0.18);
}
.story-card-text {
    font-family: var(--font-prose); color: #f3ead6;
    font-size: clamp(1.02rem, 1.6vw, 1.22rem); line-height: 1.6;
    text-shadow: 0 1px 12px rgba(0, 0, 0, 0.6);
}
.story-card-text p { margin: 0 0 0.7em; }
.story-card-text em { color: var(--gold-hi); font-style: italic; }
.story-card-text .story-say { text-align: left; }
.story-card-text .story-say strong { color: var(--gold); font-family: var(--font-title); font-size: 0.85em; letter-spacing: 0.06em; }
.story-card.is-long { align-items: center; }
.story-card.is-long .story-card-body {
    margin: 0 auto; max-height: 86vh; overflow-y: auto;
    padding: 26px 26px 18px; border-radius: 14px;
    background: rgba(2, 14, 21, 0.72); border: 1px solid var(--hairline);
    backdrop-filter: blur(4px);
}
.story-card.is-long .story-card-text { text-align: left; font-size: 1.02rem; }
.story-end-h {
    font-family: var(--font-title); color: var(--frost) !important; letter-spacing: 0.2em;
    text-transform: uppercase; font-size: 0.74rem; margin: 1.2em 0 0.4em !important;
}
.story-card-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.story-card-btn { min-width: 170px; }
.story-card-skip {
    position: absolute; top: 18px; right: 18px; z-index: 2;
    background: rgba(2, 12, 19, 0.55); color: var(--foam);
    border: 1px solid var(--hairline); border-radius: 999px;
    padding: 6px 16px; font-family: var(--font-ui); font-size: 0.85rem; cursor: pointer;
}
.story-card-skip:hover { border-color: var(--gold); color: var(--gold-hi); }

.story-day {
    position: fixed; top: 84px; left: 50%; z-index: 8000;
    transform: translate(-50%, -16px); opacity: 0; pointer-events: none;
    padding: 12px 30px 13px; border-radius: 999px;
    background: rgba(3, 18, 26, 0.86); border: 1px solid var(--hairline);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45), inset 0 -2px 0 rgba(25, 184, 191, 0.35);
    display: flex; gap: 14px; align-items: baseline;
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.story-day.is-in { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; cursor: pointer; }
.story-day-n { font-family: var(--font-title); color: var(--gold); letter-spacing: 0.18em; text-transform: uppercase; font-size: 0.8rem; }
.story-day-t { font-family: var(--font-prose); font-style: italic; color: var(--foam); font-size: 1.12rem; }

.story-choice-box h3 { font-family: var(--font-title); }

#panelJournal { padding: 18px 12px 40px; overflow-y: auto; }
.journal-wrap { max-width: 760px; margin: 0 auto; }
.journal-head {
    font-family: var(--font-title); text-align: center; margin: 6px 0 4px;
    background: var(--gold-leaf, linear-gradient(180deg, #fff5cf, #eab347));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.journal-act { text-align: center; color: var(--frost); font-family: var(--font-title); letter-spacing: 0.16em; text-transform: uppercase; font-size: 0.74rem; margin: 0 0 18px; }
.journal-empty { text-align: center; font-family: var(--font-prose); font-style: italic; opacity: 0.75; }
.journal-entry {
    background: var(--card-bg); border: 1px solid var(--border-soft);
    border-left: 3px solid var(--gold); border-radius: 10px;
    padding: 14px 18px; margin: 0 0 12px;
}
.journal-entry h3 { font-family: var(--font-title); font-size: 1rem; margin: 0 0 6px; color: var(--gold-hi); }
.journal-day { color: var(--frost); letter-spacing: 0.1em; }
.journal-entry p { font-family: var(--font-prose); font-size: 1.02rem; line-height: 1.6; margin: 0; color: #eee4cf; }

.voy-goal.voy-story { color: var(--gold-hi); }

@media (max-width: 640px) {
    .story-card-body { margin-bottom: 4vh; }
    .story-card-btn { min-width: 0; flex: 1 1 auto; }
    .story-day { top: 64px; padding: 10px 18px; }
    .story-day-t { font-size: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
    .story-card, .story-card-img, .story-card-body, .story-day { transition: none; }
}

/* Story pictures fill the whole width of the scene box: no dark bars at the
   sides (PLAN-intro-tormenta.md, fallo 6). Cropped, never letterboxed. */
.visual-story-wrapper .scene-visual-img {
    width: 100%; max-width: none;
    height: clamp(220px, 34vw, 440px); max-height: none;
    object-fit: cover; object-position: center 40%;
}

/* Between two cards of a sequence the overlay never leaves: only its picture
   and words swap, so nothing of the game underneath ever shows (fallo 3). */
.story-card .story-card-img,
.story-card .story-card-body { transition: opacity 0.32s ease, transform 0.6s ease; }
.story-card.is-in .story-card-img { transition: opacity 0.32s ease, transform 9s ease-out; }
.story-card.is-swapping .story-card-img,
.story-card.is-swapping .story-card-body { opacity: 0; }

/* The loading curtain that closes a sequence while what comes next is set up.
   Everything that moves here moves by transform or opacity only, so the
   compositor keeps it going while a long step holds the page (src/story.js
   St.curtain): the wheel turns and the sheen runs even then. */
.story-loading {
    position: absolute; left: 50%; bottom: 11vh; transform: translateX(-50%);
    width: min(460px, calc(100% - 64px)); text-align: center;
    opacity: 0; transition: opacity 0.3s ease; pointer-events: none; z-index: 2;
}
.story-card.is-loading .story-loading { opacity: 1; }
.story-card.is-loading .story-card-body,
.story-card.is-loading .story-card-skip { opacity: 0; pointer-events: none; }
/* a curtain with no picture of its own: the sea at night, like the boot screen */
.story-card.is-loading.is-plain {
    background:
        radial-gradient(ellipse 70% 55% at 50% 42%, rgba(25, 184, 191, 0.14), transparent 70%),
        radial-gradient(ellipse 120% 80% at 50% 110%, #06414b 0%, transparent 60%),
        linear-gradient(180deg, #05202b 0%, #020c13 100%);
}
.story-card.is-loading.is-plain .story-card-shade { opacity: 0; }
.story-card.is-loading.is-plain .story-loading { bottom: auto; top: 50%; transform: translate(-50%, -50%); }
.story-loading-wheel {
    width: 64px; height: 64px; margin: 0 auto 18px;
    color: var(--gold, #e9c47a);
    filter: drop-shadow(0 0 10px rgba(233, 196, 122, 0.45));
    animation: storyWheel 5.5s linear infinite;
    will-change: transform;
}
.story-loading-wheel svg { display: block; }
@keyframes storyWheel { to { transform: rotate(360deg); } }
.story-loading-label {
    font-family: var(--font-title); letter-spacing: 0.3em; text-transform: uppercase;
    font-size: 0.82rem; color: var(--frost); margin-bottom: 14px;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8);
}
.story-loading-bar {
    position: relative;
    height: 10px; border-radius: 10px; overflow: hidden;
    background: rgba(4, 16, 22, 0.72);
    box-shadow: 0 0 0 1px rgba(233, 196, 122, 0.4), 0 0 26px rgba(42, 199, 199, 0.18), inset 0 1px 3px rgba(0, 0, 0, 0.6);
}
.story-loading-fill {
    position: absolute; top: 0; right: 0; bottom: 0; left: 0;
    background: linear-gradient(90deg, var(--teal, #2ac7c7), var(--gold, #e9c47a));
    transform: scaleX(0); transform-origin: 0 50%;
    transition: transform 0.3s ease;
    will-change: transform;
}
.story-loading-sheen {
    position: absolute; top: 0; bottom: 0; left: 0; width: 34%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    transform: translateX(-110%);
    animation: storySheen 1.5s ease-in-out infinite;
    will-change: transform;
}
@keyframes storySheen { to { transform: translateX(310%); } }
html[data-motion="none"] .story-loading-wheel { animation: none; }
html[data-motion="none"] .story-loading-sheen { animation: none; display: none; }
@media (prefers-reduced-motion: reduce) {
    .story-loading-wheel, .story-loading-sheen { animation: none; }
    .story-loading-sheen { display: none; }
}

/* =====================================================================
   NOTIFICATIONS (src/notify.js, PLAN-intro-tormenta.md fallo 7)
   Face + icon + arrow + a word. Top right, under the header; they stack,
   go by themselves and never take a click.
   ===================================================================== */
.ntf-host {
    position: fixed; top: 128px; right: 16px; z-index: 8500;
    display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
    pointer-events: none; max-width: calc(100% - 32px);
}
.ntf {
    --k: var(--gold, #e9c47a);
    display: flex; align-items: center; gap: 10px;
    padding: 6px 14px 6px 6px; border-radius: 999px;
    background: linear-gradient(100deg, rgba(6, 22, 32, 0.94), rgba(10, 34, 46, 0.9));
    border: 1px solid color-mix(in srgb, var(--k) 55%, transparent);
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.45), 0 0 18px color-mix(in srgb, var(--k) 28%, transparent),
                inset 0 1px 0 rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(6px);
    transform: translateX(26px) scale(0.96); opacity: 0;
    transition: transform 0.42s cubic-bezier(.2, 1.3, .4, 1), opacity 0.3s ease;
    position: relative; overflow: hidden;
}
.ntf::after {   /* a glint that runs across once */
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.14) 50%, transparent 70%);
    transform: translateX(-120%);
}
.ntf.is-in { transform: none; opacity: 1; }
.ntf.is-in::after { transform: translateX(120%); transition: transform 0.9s ease 0.15s; }
.ntf.is-out { transform: translateX(20px); opacity: 0; transition: transform 0.4s ease, opacity 0.4s ease; }
.ntf.is-attract { --k: #ff6f8f; }
.ntf.is-trust   { --k: #2ac7c7; }
.ntf.is-jealous { --k: #b98cff; }
.ntf.is-sway    { --k: #e9c47a; }
.ntf.is-anguish { --k: #8aa0b8; }
.ntf.is-resent  { --k: #ff8a4c; }
.ntf.is-bond    { --k: #ff7fb0; }
.ntf.is-breakup { --k: #d14a5a; }
.ntf-face {
    width: 38px; height: 38px; border-radius: 50%; flex: none; overflow: hidden;
    border: 2px solid var(--k); box-shadow: 0 0 10px color-mix(in srgb, var(--k) 45%, transparent);
    display: grid; place-items: center; background: rgba(0, 0, 0, 0.4);
}
.ntf-face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ntf-face b { font-family: var(--font-title); color: var(--k); font-size: 1rem; }
.ntf-face.is-icon b { font-size: 1.2rem; }
.ntf-faces { display: flex; }
.ntf-faces .ntf-face { width: 30px; height: 30px; margin-left: -10px; }
.ntf-faces .ntf-face:first-child { margin-left: 0; }
.ntf-body { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.ntf-name {
    font-family: var(--font-title); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--frost, #cfe3ea); white-space: nowrap;
}
.ntf-what { display: flex; align-items: center; gap: 5px; color: #fff; font-size: 0.86rem; white-space: nowrap; }
.ntf-icon { font-style: normal; color: var(--k); font-size: 1.05rem; text-shadow: 0 0 8px var(--k); }
.ntf.is-in .ntf-icon { animation: ntfBeat 0.7s ease 0.2s 1; }
.ntf-arrow { font-style: normal; font-size: 0.62rem; }
.ntf-arrow.is-up { color: #7ff0b8; }
.ntf-arrow.is-down { color: #ff7a7a; }
.ntf-word { color: rgba(255, 255, 255, 0.85); }
@keyframes ntfBeat { 0% { transform: scale(1); } 35% { transform: scale(1.45); } 100% { transform: scale(1); } }

/* The big one: a breakup or a new couple, top centre, no button. */
.ntf-big {
    --k: #d14a5a;
    position: fixed; top: 110px; left: 50%; z-index: 8600; pointer-events: none;
    transform: translate(-50%, -12px); opacity: 0;
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    padding: 16px 26px 14px; border-radius: 22px;
    background: radial-gradient(120% 140% at 50% 0%, rgba(20, 30, 44, 0.96), rgba(4, 12, 20, 0.96));
    border: 1px solid color-mix(in srgb, var(--k) 55%, transparent);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6), 0 0 40px color-mix(in srgb, var(--k) 30%, transparent);
    transition: transform 0.5s cubic-bezier(.2, 1.2, .4, 1), opacity 0.4s ease;
    max-width: calc(100% - 32px);
}
.ntf-big.is-bond { --k: #ff7fb0; }
.ntf-big.is-in { transform: translate(-50%, 0); opacity: 1; }
.ntf-big.is-out { opacity: 0; transform: translate(-50%, -10px); transition: opacity 0.6s ease, transform 0.6s ease; }
.ntf-big-pair { display: flex; align-items: center; gap: 6px; }
.ntf-big .ntf-face.is-big { width: 64px; height: 64px; border-width: 3px; transition: transform 0.9s cubic-bezier(.3, 1.2, .4, 1), filter 0.9s ease; }
.ntf-big-heart { position: relative; width: 34px; height: 34px; display: block; }
.ntf-big-heart i {
    position: absolute; inset: 0; font-style: normal; font-size: 30px; line-height: 34px; text-align: center;
    color: var(--k); text-shadow: 0 0 14px var(--k); transition: transform 0.8s cubic-bezier(.3, 1.4, .4, 1), opacity 0.8s ease;
}
.ntf-big-heart .h-l { clip-path: polygon(0 0, 55% 0, 42% 30%, 58% 52%, 40% 75%, 50% 100%, 0 100%); }
.ntf-big-heart .h-r { clip-path: polygon(55% 0, 100% 0, 100% 100%, 50% 100%, 40% 75%, 58% 52%, 42% 30%); }
.ntf-big.is-breakup.is-split .h-l { transform: translate(-7px, 3px) rotate(-14deg); }
.ntf-big.is-breakup.is-split .h-r { transform: translate(7px, 3px) rotate(14deg); }
.ntf-big.is-breakup.is-split .is-left { transform: translateX(-14px); filter: grayscale(0.7); }
.ntf-big.is-breakup.is-split .is-right { transform: translateX(14px); filter: grayscale(0.7); }
.ntf-big.is-bond .is-left { transform: translateX(-10px); }
.ntf-big.is-bond .is-right { transform: translateX(10px); }
.ntf-big.is-bond.is-split .is-left, .ntf-big.is-bond.is-split .is-right { transform: none; }
.ntf-big.is-bond.is-split .ntf-big-heart i { transform: scale(1.25); }
.ntf-big-text { font-family: var(--font-title); letter-spacing: 0.08em; color: #fff; font-size: 0.95rem; text-align: center; }

@media (max-width: 640px) {
    .ntf-host { top: 96px; right: 8px; }
    .ntf { padding: 4px 10px 4px 4px; gap: 7px; }
    .ntf-face { width: 32px; height: 32px; }
    .ntf-what { font-size: 0.8rem; }
}
@media (prefers-reduced-motion: reduce) {
    .ntf, .ntf-big, .ntf-big * { transition: opacity 0.2s ease !important; }
    .ntf.is-in .ntf-icon { animation: none; }
}

/* =====================================================================
   THE OPENING ON STAGE (src/story-intro.js, PLAN-intro-tormenta.md §3-4)
   The 3D sea full-screen over everything; letterbox bars, medallions with
   bubbles, a caption for the narration, decisions and minigame controls.
   ===================================================================== */
body.story-staged #app { visibility: hidden; }
.ss-stage {
    position: fixed; inset: 0; z-index: 8000; display: none;
    background: #02090f; overflow: hidden; user-select: none; -webkit-user-select: none;
    font-family: var(--font-body, Georgia, serif);
}
.ss-host, .ss-host .sea3d-stage { position: absolute; inset: 0; width: 100%; height: 100%; }
.sea3d-stage.is-story .sea-int, .sea3d-stage.is-story .sea3d-hud, .sea3d-stage.is-story .sea3d-land,
.sea3d-stage.is-story .sea3d-tools, .sea3d-stage.is-story .sea3d-dock { display: none !important; }
.ss-dark { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 1.5s ease;
    background: radial-gradient(120% 90% at 50% 45%, transparent 45%, rgba(0, 6, 12, 0.75) 100%); }
.ss-stage.is-storm .ss-dark { opacity: 1; }
.ss-stage.is-dawn .ss-dark { opacity: 0.45; }
.ss-bar { position: absolute; left: 0; right: 0; height: 7vh; background: #000; z-index: 3; pointer-events: none; }
.ss-bar.is-top { top: 0; }
.ss-bar.is-bottom { bottom: 0; }

.ss-faces, .ss-hots { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.ss-face {
    --c: #e9c47a;
    position: absolute; left: 0; top: 0; width: 46px; height: 46px; margin: -23px 0 0 -23px;
    border-radius: 50%; border: 2px solid var(--c); background: #0a1a24; overflow: visible;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55), 0 0 12px color-mix(in srgb, var(--c) 40%, transparent);
    opacity: 0; transition: opacity 0.5s ease, box-shadow 0.3s ease, scale 0.3s ease; will-change: transform;
}
.ss-face.is-in { opacity: 1; }
.ss-face.is-off { opacity: 0 !important; }
.ss-face img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.ss-face b { display: grid; place-items: center; width: 100%; height: 100%; color: var(--c); font-family: var(--font-title); }
.ss-face-name {
    position: absolute; top: 100%; left: 50%; transform: translate(-50%, 4px); white-space: nowrap;
    font-family: var(--font-title); font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase;
    color: #fff; text-shadow: 0 1px 4px #000, 0 0 8px #000;
}
.ss-face-name em { color: var(--gold-hi, #ffe2a0); font-style: normal; }
.ss-face.is-talking { scale: 1.18; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15), 0 0 22px var(--c); }

.ss-bubble {
    --c: #e9c47a; --tail: 0px;
    position: absolute; z-index: 4; max-width: min(420px, calc(100% - 32px));
    transform: translate(-50%, -100%) scale(0.92); opacity: 0; pointer-events: none;
    padding: 10px 16px 12px; border-radius: 16px;
    background: linear-gradient(180deg, rgba(10, 26, 36, 0.96), rgba(6, 16, 24, 0.96));
    border: 1px solid color-mix(in srgb, var(--c) 60%, transparent);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55), 0 0 18px color-mix(in srgb, var(--c) 25%, transparent);
    color: #f3efe6; font-size: 1.02rem; line-height: 1.4;
    transition: opacity 0.22s ease, transform 0.25s cubic-bezier(.2, 1.3, .4, 1);
}
.ss-bubble::after {
    content: ""; position: absolute; left: calc(50% + var(--tail)); bottom: -7px; width: 12px; height: 12px;
    transform: translateX(-50%) rotate(45deg); background: rgba(6, 16, 24, 0.96);
    border-right: 1px solid color-mix(in srgb, var(--c) 60%, transparent);
    border-bottom: 1px solid color-mix(in srgb, var(--c) 60%, transparent);
}
.ss-bubble.is-on { opacity: 1; transform: translate(-50%, -100%) scale(1); }
.ss-bubble.is-free { left: 50% !important; top: auto !important; bottom: calc(7vh + 120px); transform: translate(-50%, 0); }
.ss-bubble.is-free::after { display: none; }
.ss-bubble-name { display: block; font-family: var(--font-title); font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--c); margin-bottom: 3px; }
.ss-more { position: absolute; right: 10px; bottom: 4px; font-style: normal; font-size: 0.7rem; color: var(--gold, #e9c47a); animation: ssMore 1.1s ease-in-out infinite; }
@keyframes ssMore { 50% { transform: translateY(3px); opacity: 0.5; } }

.ss-cap {
    position: absolute; left: 50%; bottom: calc(7vh + 18px); z-index: 4; width: min(760px, calc(100% - 32px));
    transform: translate(-50%, 8px); opacity: 0; pointer-events: none; text-align: center;
    padding: 14px 22px 16px; border-radius: 14px;
    background: linear-gradient(180deg, rgba(2, 10, 16, 0.55), rgba(2, 10, 16, 0.82));
    color: #f5f0e4; font-size: 1.1rem; line-height: 1.5; font-style: italic;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8); transition: opacity 0.3s ease, transform 0.3s ease;
}
.ss-cap.is-on { opacity: 1; transform: translate(-50%, 0); }
.ss-cap em { color: var(--gold-hi, #ffe2a0); }

.ss-choice {
    position: absolute; left: 50%; bottom: calc(7vh + 14px); z-index: 5; width: min(680px, calc(100% - 32px));
    transform: translate(-50%, 14px); opacity: 0; pointer-events: none; transition: opacity 0.25s ease, transform 0.3s ease;
    padding: 14px; border-radius: 16px; background: rgba(4, 14, 22, 0.88);
    border: 1px solid rgba(233, 196, 122, 0.35); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}
.ss-choice.is-on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.ss-choice-ask { font-family: var(--font-title); color: var(--gold-hi, #ffe2a0); letter-spacing: 0.06em; margin: 0 0 10px; text-align: center; font-size: 1.05rem; }
.ss-choice-opts { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.ss-opt { margin: 0 !important; width: 100%; }
.ss-timer { height: 5px; border-radius: 5px; overflow: hidden; background: rgba(255, 255, 255, 0.08); margin: -2px 0 10px; }
.ss-timer i { display: block; height: 100%; background: linear-gradient(90deg, #ff6b5a, #e9c47a); transform-origin: left; transform: scaleX(1); transition-property: transform; transition-timing-function: linear; }

.ss-skip {
    position: absolute; top: calc(7vh + 12px); right: 16px; z-index: 6;
    padding: 6px 14px; border-radius: 999px; cursor: pointer;
    background: rgba(0, 0, 0, 0.45); color: rgba(255, 255, 255, 0.75); border: 1px solid rgba(255, 255, 255, 0.2);
    font-family: var(--font-title); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase;
}
.ss-skip:hover { color: #fff; border-color: var(--gold, #e9c47a); }

.ss-toast {
    position: absolute; left: 50%; top: 32%; z-index: 6; transform: translate(-50%, 0) scale(0.8); opacity: 0;
    font-family: var(--font-title); font-size: 2rem; letter-spacing: 0.08em; color: #fff; pointer-events: none;
    text-shadow: 0 0 18px rgba(0, 0, 0, 0.8), 0 0 30px var(--gold, #e9c47a);
    transition: opacity 0.2s ease, transform 0.35s cubic-bezier(.2, 1.4, .4, 1);
}
.ss-toast.is-on { opacity: 1; transform: translate(-50%, 0) scale(1); }
.ss-toast.is-good { color: #9dffcf; }
.ss-toast.is-bad { color: #ffb19a; }

/* minigames */
.ss-game { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.ss-game > * { pointer-events: auto; }
.ss-hint {
    position: absolute; left: 50%; bottom: calc(7vh + 22px); transform: translateX(-50%);
    padding: 8px 18px; border-radius: 999px; background: rgba(0, 0, 0, 0.55); color: #fff;
    font-family: var(--font-title); letter-spacing: 0.08em; font-size: 0.9rem; white-space: nowrap; pointer-events: none !important;
}
.ss-hint.is-top { top: calc(7vh + 16px); bottom: auto; }
.ss-hint b { color: var(--gold-hi, #ffe2a0); margin-left: 6px; }
.ss-hot {
    position: absolute; left: 0; top: 0; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%;
    border: 0; background: transparent; cursor: pointer; pointer-events: auto; display: grid; place-items: center;
}
.ss-hot i { position: absolute; inset: 8px; border-radius: 50%; border: 3px solid var(--gold, #e9c47a);
    box-shadow: 0 0 16px var(--gold, #e9c47a), inset 0 0 12px rgba(233, 196, 122, 0.5); animation: ssPulse 1.2s ease-in-out infinite; }
.ss-hot span { position: relative; font-family: var(--font-title); color: #fff; font-size: 1.1rem; text-shadow: 0 0 6px #000; }
.ss-hot.is-done i { animation: none; transform: scale(1.8); opacity: 0; transition: all 0.4s ease; }
.ss-hot.is-off { visibility: hidden; }
@keyframes ssPulse { 50% { transform: scale(1.18); opacity: 0.7; } }
.ss-splash { position: absolute; left: 0; top: 0; width: 120px; height: 60px; margin: -40px 0 0 -60px; pointer-events: none;
    background: radial-gradient(closest-side, rgba(255, 255, 255, 0.9), rgba(200, 235, 245, 0.4) 60%, transparent);
    animation: ssSplash 1.2s ease-out forwards; }
@keyframes ssSplash { 0% { transform: scale(0.2); opacity: 1; } 100% { transform: scale(1.6) translateY(-20px); opacity: 0; } }

.ss-drive { position: absolute; left: 0; right: 0; bottom: calc(7vh + 16px); display: flex; justify-content: space-between; align-items: flex-end; padding: 0 22px; pointer-events: none !important; }
.ss-drive > * { pointer-events: auto; }
.ss-drive-help { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); text-align: center; color: rgba(255, 255, 255, 0.8);
    font-size: 0.82rem; text-shadow: 0 1px 4px #000; pointer-events: none !important; }
.ss-hold {
    min-width: 92px; height: 92px; border-radius: 50%; cursor: pointer; touch-action: none;
    border: 2px solid var(--gold, #e9c47a); color: #fff; font-family: var(--font-title); letter-spacing: 0.06em; font-size: 0.85rem;
    background: radial-gradient(circle at 50% 35%, rgba(42, 199, 199, 0.35), rgba(4, 18, 28, 0.92));
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.55), 0 0 18px rgba(233, 196, 122, 0.25); transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.ss-hold.is-down { transform: scale(0.93); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.6), 0 0 28px rgba(233, 196, 122, 0.7);
    background: radial-gradient(circle at 50% 35%, rgba(233, 196, 122, 0.5), rgba(4, 18, 28, 0.92)); }
.ss-hold.is-throttle, .ss-hold.is-anchor { width: 120px; height: 120px; }
.ss-steer { display: flex; gap: 14px; }
.ss-steer .ss-hold { min-width: 76px; width: 76px; height: 76px; font-size: 1.5rem; }
.ss-game.is-anchor .ss-hold { position: absolute; right: 26px; bottom: calc(7vh + 20px); }
.ss-game.is-helm .ss-steer { position: absolute; left: 50%; bottom: calc(7vh + 18px); transform: translateX(-50%); gap: 120px; }

.ss-gauge { position: absolute; right: 40px; top: 50%; transform: translateY(-50%); width: 26px; height: 46vh; border-radius: 14px;
    background: rgba(0, 0, 0, 0.5); border: 1px solid rgba(255, 255, 255, 0.25); overflow: hidden; pointer-events: none !important; }
.ss-gauge-zone { position: absolute; left: 0; right: 0; bottom: 66%; height: 20%; background: rgba(110, 255, 170, 0.28); border-top: 1px solid #7dffb5; border-bottom: 1px solid #7dffb5; }
.ss-gauge-fill { position: absolute; left: 3px; right: 3px; bottom: 3px; top: 3px; border-radius: 10px; transform-origin: bottom; transform: scaleY(0);
    background: linear-gradient(0deg, #2ac7c7, #e9c47a); }
.ss-gauge-fill.is-green { background: linear-gradient(0deg, #2ac7c7, #7dffb5); box-shadow: 0 0 16px #7dffb5; }
.ss-game.is-anchor .ss-gauge { right: 170px; }

.ss-helm { position: absolute; left: 50%; bottom: calc(7vh + 120px); transform: translateX(-50%); width: 300px; height: 160px; pointer-events: none !important; }
.ss-helm-arc { position: absolute; inset: 0; border-radius: 300px 300px 0 0; border: 3px solid rgba(255, 255, 255, 0.35); border-bottom: 0;
    background: radial-gradient(circle at 50% 100%, rgba(4, 14, 22, 0.85) 60%, rgba(4, 14, 22, 0.5)); overflow: hidden; }
.ss-helm-band { position: absolute; left: 50%; bottom: 0; width: 120px; height: 150px; transform: translateX(-50%);
    background: conic-gradient(from -24deg at 50% 100%, rgba(110, 255, 170, 0.35) 0deg 48deg, transparent 48deg); }
.ss-helm-needle { position: absolute; left: 50%; bottom: 0; width: 4px; height: 140px; margin-left: -2px; border-radius: 4px;
    background: #ff8a6a; transform-origin: 50% 100%; box-shadow: 0 0 10px #ff8a6a; }
.ss-helm-needle.is-ok { background: #7dffb5; box-shadow: 0 0 12px #7dffb5; }
.ss-helm-warn { position: absolute; top: 40%; font-size: 2.4rem; color: #ff7a5a; opacity: 0; text-shadow: 0 0 16px #ff7a5a; transition: opacity 0.15s ease; }
.ss-helm-warn.is-l { left: -60px; }
.ss-helm-warn.is-r { right: -60px; }
.ss-helm-warn.is-on { opacity: 1; animation: ssPulse 0.4s ease-in-out infinite; }

.ss-rope { position: absolute; left: 50%; bottom: calc(7vh + 60px); transform: translateX(-50%); width: min(560px, calc(100% - 48px)); height: 74px;
    border-radius: 40px; background: linear-gradient(180deg, rgba(10, 40, 60, 0.85), rgba(2, 12, 20, 0.9)); border: 1px solid rgba(255, 255, 255, 0.25); cursor: pointer; }
.ss-rope-target { position: absolute; top: 50%; width: 52px; height: 52px; margin-top: -26px; border-radius: 50%; overflow: hidden; border: 3px solid #fff; box-shadow: 0 0 18px rgba(255, 255, 255, 0.6); }
.ss-rope-target img { width: 100%; height: 100%; object-fit: cover; }
.ss-rope-mark { position: absolute; top: 6px; bottom: 6px; width: 6px; margin-left: -3px; border-radius: 6px; background: var(--gold, #e9c47a); box-shadow: 0 0 14px var(--gold, #e9c47a); }
.ss-rope-mark.is-hit { background: #7dffb5; box-shadow: 0 0 20px #7dffb5; }
.ss-rope-mark.is-miss { background: #ff7a5a; box-shadow: 0 0 20px #ff7a5a; }

@media (max-width: 640px) {
    .ss-bar { height: 5vh; }
    .ss-cap { font-size: 0.98rem; bottom: calc(5vh + 12px); }
    .ss-choice { bottom: calc(5vh + 10px); }
    .ss-hold.is-throttle, .ss-hold.is-anchor { width: 96px; height: 96px; }
    .ss-steer .ss-hold { width: 64px; height: 64px; min-width: 64px; }
    .ss-helm { width: 240px; height: 130px; bottom: calc(5vh + 110px); }
    .ss-gauge { right: 18px; }
    .ss-game.is-anchor .ss-gauge { right: 140px; }
    .ss-face { width: 38px; height: 38px; margin: -19px 0 0 -19px; }
}

/* =====================================================================
   BREAKUPS (src/heartbreak.js, PLAN-intro-tormenta.md §10): the colour
   drains out of the game for a few seconds and rain runs down the glass.
   ===================================================================== */
#app { transition: filter 1.2s ease; }
body.fx-heartbreak #app { filter: grayscale(0.85) brightness(0.82) contrast(1.05); }
.fx-rain {
    position: fixed; inset: 0; z-index: 8400; pointer-events: none; opacity: 0;
    transition: opacity 1.4s ease;
    background-image:
        radial-gradient(2px 7px at 12% 18%, rgba(255, 255, 255, 0.35), transparent 70%),
        radial-gradient(2px 9px at 34% 62%, rgba(255, 255, 255, 0.3), transparent 70%),
        radial-gradient(3px 8px at 58% 30%, rgba(255, 255, 255, 0.3), transparent 70%),
        radial-gradient(2px 10px at 77% 74%, rgba(255, 255, 255, 0.32), transparent 70%),
        radial-gradient(2px 6px at 88% 12%, rgba(255, 255, 255, 0.3), transparent 70%),
        radial-gradient(3px 9px at 46% 88%, rgba(255, 255, 255, 0.28), transparent 70%),
        radial-gradient(2px 8px at 22% 84%, rgba(255, 255, 255, 0.3), transparent 70%),
        radial-gradient(2px 7px at 67% 52%, rgba(255, 255, 255, 0.3), transparent 70%);
    background-size: 340px 300px;
    animation: fxRain 2.4s linear infinite;
}
body.fx-heartbreak .fx-rain { opacity: 1; }
@keyframes fxRain { from { background-position: 0 0; } to { background-position: 0 300px; } }
@media (prefers-reduced-motion: reduce) { .fx-rain { animation: none; } }

/* ---- the throttle lever and the wheel (story-intro.js makeLever / makeWheel) ----
   A brass lever swinging over an engraved dial; a varnished wheel with brass. */
.ss-lever {
    --pow: 0;
    position: relative; width: 206px; padding: 10px 10px 12px; border-radius: 20px; touch-action: none; cursor: grab;
    background:
        radial-gradient(120% 90% at 20% 0%, rgba(233, 196, 122, 0.10), transparent 60%),
        linear-gradient(180deg, rgba(14, 33, 45, 0.94), rgba(4, 13, 20, 0.96));
    border: 1px solid rgba(233, 196, 122, 0.5);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 240, 200, 0.12), inset 0 0 0 3px rgba(0, 0, 0, 0.25);
    user-select: none; -webkit-user-select: none;
}
.ss-lever.is-grab { cursor: grabbing; }
.ss-lever-label, .ss-wheel-label {
    font-family: var(--font-title); font-size: 0.68rem; letter-spacing: 0.22em; text-transform: uppercase;
    color: var(--gold, #e9c47a); text-align: center; margin-bottom: 4px; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}
.ss-lever-svg { display: block; width: 100%; height: auto; overflow: visible; }
.ss-lever .plate { fill: url(#ssDial); stroke: rgba(0, 0, 0, 0.6); stroke-width: 1; }
.ss-lever .plate-rim { fill: none; stroke: url(#ssBrass); stroke-width: 3.2; stroke-linecap: round; }
.ss-lever .glow-track { fill: none; stroke: rgba(255, 255, 255, 0.07); stroke-width: 5; stroke-linecap: round; }
.ss-lever .glow { fill: none; stroke: #e9c47a; stroke-width: 5; stroke-linecap: round; stroke-dasharray: 0 100;
    filter: drop-shadow(0 0 4px rgba(255, 205, 110, 0.85)); transition: stroke 0.2s; }
.ss-lever .tk { stroke: rgba(240, 214, 160, 0.55); stroke-width: 1.4; stroke-linecap: round; }
.ss-lever .tk-major { stroke: #f2d694; stroke-width: 2.6; }
.ss-lever .lb { font-family: var(--font-title); font-size: 15px; letter-spacing: 0.04em; fill: rgba(244, 226, 186, 0.62);
    text-anchor: start; transition: fill 0.2s; }
.ss-lever .lb.is-on { fill: #fff3cf; filter: drop-shadow(0 0 3px rgba(255, 210, 120, 0.9)); }
.ss-lever .arm { fill: url(#ssBrass); stroke: #5e3f10; stroke-width: 0.8; }
.ss-lever .arm-shine { fill: rgba(255, 250, 225, 0.75); }
.ss-lever .knob { fill: url(#ssKnob); stroke: #2b1407; stroke-width: 0.8; }
.ss-lever .knob-shine { fill: rgba(255, 228, 190, 0.45); }
.ss-lever .pivot { fill: url(#ssBrassR); stroke: #4f3509; stroke-width: 1; }
.ss-lever .pivot2 { fill: #3a2608; }
.ss-lever-arm { transition: transform 0.08s linear; }
.ss-lever.is-grab .knob { stroke: #ffd890; stroke-width: 1.4; }
.ss-lever.is-thunk .ss-lever-svg { animation: ssThunk 0.18s ease-out; }
@keyframes ssThunk { 0% { transform: translateY(0); } 35% { transform: translateY(1.5px); } 100% { transform: translateY(0); } }
.ss-lever-read { margin-top: 2px; text-align: center; font-family: var(--font-title); color: #fff; font-size: 1.05rem; letter-spacing: 0.06em;
    text-shadow: 0 0 calc(var(--pow) * 14px) rgba(255, 205, 110, 0.9); }

.ss-wheel {
    position: relative; width: 210px; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none;
    filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.65));
}
.ss-wheel.is-grab { cursor: grabbing; }
.ss-wheel-box { position: relative; width: 210px; height: 210px; }
.ss-wheel-rot { width: 100%; height: 100%; will-change: transform; }
.ss-wheel-rot svg { width: 100%; height: 100%; display: block; overflow: visible; }
.ss-wheel .sp { fill: url(#ssSpoke); stroke: #3a1a07; stroke-width: 0.6; }
.ss-wheel .sp-shine { fill: rgba(255, 214, 160, 0.35); }
.ss-wheel .hd { fill: url(#ssHandle); stroke: #2e1405; stroke-width: 0.6; }
.ss-wheel .hd-shine { fill: none; stroke: rgba(255, 226, 180, 0.6); stroke-width: 1; stroke-linecap: round; }
.ss-wheel .ferrule { fill: url(#ssBand); stroke: #5e3f10; stroke-width: 0.4; }
.ss-wheel .turk rect { fill: #e9d6a8; stroke: #8a6a35; stroke-width: 0.5; }
.ss-wheel .turk path { fill: none; stroke: #8a6a35; stroke-width: 0.7; }
.ss-wheel .rivet { fill: url(#ssBoss); stroke: #4f3509; stroke-width: 0.4; }
.ss-wheel .rim { fill: none; stroke: url(#ssWood); stroke-width: 10.6; }
.ss-wheel .gr { fill: none; stroke-width: 0.7; }
.ss-wheel .gr0 { stroke: #3b1a07; }
.ss-wheel .gr1 { stroke: #d99a5e; }
.ss-wheel .rim-in, .ss-wheel .rim-out { fill: none; stroke: #2e1405; stroke-width: 0.9; }
.ss-wheel .band { fill: none; stroke: url(#ssBand); stroke-width: 2.4; opacity: 0.95; }
.ss-wheel .boss-wood { fill: url(#ssWood); stroke: #2e1405; stroke-width: 0.8; }
.ss-wheel .boss { fill: url(#ssBoss); }
.ss-wheel .boss-ring { fill: none; stroke: #5e3f10; stroke-width: 1.2; }
.ss-wheel .boss-nut { fill: #fff0c0; stroke: #8f6420; stroke-width: 1; }
/* the varnish: a highlight that stays put while the wheel turns under it */
.ss-wheel-gloss {
    position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
    background:
        radial-gradient(38% 22% at 32% 22%, rgba(255, 240, 210, 0.38), transparent 70%),
        radial-gradient(30% 14% at 70% 84%, rgba(255, 200, 140, 0.14), transparent 70%);
    mix-blend-mode: screen;
    -webkit-mask: radial-gradient(circle at 50% 50%, transparent 0 28%, #000 29% 37%, transparent 38%);
            mask: radial-gradient(circle at 50% 50%, transparent 0 28%, #000 29% 37%, transparent 38%);
}
.ss-wheel.is-grab .band { stroke: #ffe3a0; }
.ss-wheel-read { position: relative; height: 6px; margin: 6px 24px 0; border-radius: 6px; background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(233, 196, 122, 0.35); }
.ss-wheel-read::before { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: rgba(255, 255, 255, 0.4); }
.ss-wheel-read i { position: absolute; top: -4px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fff3c8, #c99a45 60%, #6e4d17); box-shadow: 0 0 10px var(--gold, #e9c47a); }
.ss-game.is-helm .ss-wheel { position: absolute; left: 50%; bottom: calc(7vh + 10px); transform: translateX(-50%); }
.ss-game.is-helm .ss-helm { bottom: calc(7vh + 260px); }
.ss-game.is-drive .ss-drive { align-items: flex-end; }
.ss-game.is-drive .ss-drive-help { bottom: 0; }

@media (max-width: 640px), (max-height: 520px) {
    .ss-wheel, .ss-wheel-box { width: 156px; }
    .ss-wheel-box { height: 156px; }
    .ss-lever { width: 164px; padding: 8px 6px 10px; }
    .ss-game.is-helm .ss-helm { bottom: calc(5vh + 205px); }
}

/* ---- THE BRIDGE: first person at the helm (story-intro.js bridgeHud) ---- */
.ss-stage.is-bridge .ss-faces, .ss-stage.is-bridge .ss-bar, .ss-stage.is-bridge .ss-cap, .ss-stage.is-bridge .ss-bubble { display: none; }
.ss-game.is-bridge { position: absolute; inset: 0; pointer-events: none; }
.ss-game.is-bridge > * { pointer-events: none; }
.ss-game.is-bridge .ss-dash-wheel, .ss-game.is-bridge .ss-dash-right, .ss-game.is-bridge .ss-wheel, .ss-game.is-bridge .ss-lever { pointer-events: auto; }
.ss-host.is-punch { animation: ssPunch 0.42s cubic-bezier(.2, .9, .3, 1); }
@keyframes ssPunch { 0% { transform: scale(1); } 30% { transform: scale(1.045); } 100% { transform: scale(1); } }

/* the compass: a strip of bearings sliding under a lubber line */
.ss-compass {
    position: absolute; left: 50%; top: 12px; width: 240px; height: 34px; margin-left: -120px; overflow: hidden;
    border-radius: 17px; border: 1px solid rgba(233, 196, 122, 0.55);
    background: linear-gradient(180deg, rgba(8, 22, 30, 0.82), rgba(3, 10, 15, 0.9));
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 240, 200, 0.1);
    -webkit-mask: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
            mask: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
}
.ss-compass-tape { position: absolute; left: 120px; top: 0; bottom: 0; will-change: transform; }
.ss-compass-tape span {
    position: absolute; top: 18px; width: 2px; height: 7px; margin-left: -1px; background: rgba(240, 214, 160, 0.45);
    font: 600 10px/1 var(--font-title); color: rgba(240, 214, 160, 0.75); text-indent: -999px; overflow: visible;
}
.ss-compass-tape span.is-card, .ss-compass-tape span.is-mid { height: 0; background: none; text-indent: 0; top: 7px; width: 30px; margin-left: -15px; text-align: center; }
.ss-compass-tape span.is-card { color: #ffe7a8; font-size: 13px; top: 5px; }
.ss-compass-lub { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: linear-gradient(180deg, #ffd890, rgba(255, 216, 144, 0)); }
.ss-compass-goal {
    position: absolute; left: 50%; bottom: 2px; width: 0; height: 0; margin-left: -6px; opacity: 0;
    border: 6px solid transparent; border-bottom: 8px solid #6ff0e6; border-top: 0;
    filter: drop-shadow(0 0 4px rgba(111, 240, 230, 0.9)); transition: opacity 0.3s;
}
.ss-compass-goal.is-on { border-bottom-color: #ffe08a; filter: drop-shadow(0 0 6px rgba(255, 224, 138, 1)); }
.ss-bridge-hint.ss-hint.is-top { top: 58px; font-size: 0.74rem; max-width: min(70vw, 520px); left: 50%; right: auto; transform: translateX(-50%); white-space: normal; text-align: center; }

/* the goal, in the world: a buoy gate, the sea coming */
.ss-goal { position: absolute; left: 0; top: 0; opacity: 0; transition: opacity 0.25s; will-change: transform; }
.ss-goal.is-on { opacity: 1; }
.ss-goal i {
    position: absolute; left: -15px; top: -15px; width: 30px; height: 30px; border-radius: 50%;
    border: 2px solid #6ff0e6; box-shadow: 0 0 14px rgba(111, 240, 230, 0.7), inset 0 0 10px rgba(111, 240, 230, 0.4);
    animation: ssGoal 1.4s ease-in-out infinite;
}
.ss-goal span {
    position: absolute; left: 0; top: -40px; transform: translateX(-50%); white-space: nowrap;
    font: 600 11px/1 var(--font-title); letter-spacing: 0.1em; color: #dffcf9; text-shadow: 0 1px 4px #000, 0 0 10px rgba(0, 0, 0, 0.8);
}
.ss-goal.is-wave i { border-color: #ff9a6a; box-shadow: 0 0 18px rgba(255, 130, 80, 0.85); width: 44px; height: 44px; left: -22px; top: -22px; }
.ss-goal.is-wave span { color: #ffd1b8; font-size: 12px; top: -50px; }
@keyframes ssGoal { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }

/* which side the sea comes from */
.ss-wave-warn {
    position: absolute; top: 38%; font-size: 46px; color: #ff9a6a; opacity: 0; transition: opacity 0.2s;
    text-shadow: 0 0 18px rgba(255, 120, 60, 0.9), 0 2px 6px #000;
}
.ss-wave-warn.is-l { left: 3%; } .ss-wave-warn.is-r { right: 3%; }
.ss-wave-warn.is-on { opacity: 1; animation: ssWarn 0.5s ease-in-out infinite alternate; }
@keyframes ssWarn { from { transform: translateX(0) scale(1); } to { transform: translateX(var(--wx, 0)) scale(1.15); } }
.ss-wave-warn.is-l.is-on { --wx: -8px; } .ss-wave-warn.is-r.is-on { --wx: 8px; }

/* water on the glass */
.ss-drops { position: absolute; inset: 0; opacity: 0;
    background:
        radial-gradient(14px 18px at 12% 22%, rgba(220, 245, 255, 0.35), transparent 70%),
        radial-gradient(10px 14px at 30% 64%, rgba(220, 245, 255, 0.3), transparent 70%),
        radial-gradient(22px 26px at 52% 30%, rgba(220, 245, 255, 0.28), transparent 70%),
        radial-gradient(12px 16px at 71% 18%, rgba(220, 245, 255, 0.32), transparent 70%),
        radial-gradient(18px 22px at 84% 56%, rgba(220, 245, 255, 0.3), transparent 70%),
        radial-gradient(9px 12px at 42% 82%, rgba(220, 245, 255, 0.3), transparent 70%),
        radial-gradient(16px 20px at 63% 72%, rgba(220, 245, 255, 0.26), transparent 70%),
        radial-gradient(120% 90% at 50% 0%, rgba(200, 230, 240, 0.18), transparent 60%);
    backdrop-filter: blur(calc(var(--k, 1) * 1.6px)); -webkit-backdrop-filter: blur(calc(var(--k, 1) * 1.6px)); }
.ss-drops.is-on { animation: ssDrops 2.4s ease-out forwards; }
@keyframes ssDrops { 0% { opacity: 0; transform: translateY(-10px); } 8% { opacity: var(--k, 1); } 100% { opacity: 0; transform: translateY(26px); } }

/* the big words that jump: Clean! / Spot on! / Beam on! */
.ss-pop {
    position: absolute; left: 50%; top: 30%; transform: translate(-50%, -50%) scale(0.6); opacity: 0;
    font-family: var(--font-title); font-size: clamp(1.6rem, 6vw, 2.8rem); letter-spacing: 0.06em; white-space: nowrap;
    color: #fff3cf; text-shadow: 0 0 22px rgba(255, 205, 110, 0.9), 0 3px 10px rgba(0, 0, 0, 0.8);
}
.ss-pop.is-on { animation: ssPop 1.2s cubic-bezier(.2, 1.4, .4, 1) forwards; }
.ss-pop.is-bad { color: #ffd1b8; text-shadow: 0 0 22px rgba(255, 120, 60, 0.9), 0 3px 10px rgba(0, 0, 0, 0.8); }
@keyframes ssPop { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5) rotate(-4deg); } 18% { opacity: 1; transform: translate(-50%, -50%) scale(1.12) rotate(1deg); }
    30% { transform: translate(-50%, -50%) scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -62%) scale(1); } }

/* the console in the foreground: teak, leather, brass; the wheel rises out of it */
.ss-dash {
    position: absolute; left: 0; right: 0; bottom: 0; height: 17%; min-height: 76px;
    background:
        linear-gradient(180deg, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0.35) 100%),
        repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.07) 0 2px, transparent 2px 9px, rgba(255, 220, 170, 0.04) 9px 10px, transparent 10px 23px),
        linear-gradient(180deg, #4a2511 0%, #2c1408 55%, #1a0b04 100%);
    border-top: 3px solid #c99a45;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.55), inset 0 2px 0 rgba(255, 230, 170, 0.25);
}
.ss-dash-top { position: absolute; left: 0; right: 0; top: 0; height: 12px; background: linear-gradient(180deg, #171310, #0a0806);
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.06); }
.ss-dash-wheel { position: absolute; left: 50%; bottom: -150px; transform: translateX(-50%); }
.ss-dash-wheel .ss-wheel { width: 300px; }
.ss-dash-wheel .ss-wheel-box { width: 300px; height: 300px; }
.ss-dash-wheel .ss-wheel-label, .ss-dash-wheel .ss-wheel-read { display: none; }
.ss-dash-right { position: absolute; right: 2%; bottom: 6px; }
.ss-dash-right .ss-lever { width: 178px; }
.ss-dash-note { font: 600 11px/1.2 var(--font-title); letter-spacing: 0.12em; text-transform: uppercase; color: #ffb08a; padding: 8px 12px;
    border: 1px solid rgba(255, 140, 90, 0.5); border-radius: 10px; background: rgba(30, 8, 4, 0.7); animation: ssWarn 0.7s ease-in-out infinite alternate; }
.ss-dash-gauge { position: absolute; left: 3%; bottom: 14px; width: 74px; text-align: center; }
.ss-dash-gauge svg { width: 74px; height: 74px; display: block; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.6)); }
.ss-dash-gauge span { font: 600 9px/1 var(--font-title); letter-spacing: 0.2em; color: #e9c47a; }
.ss-dash-gauge .g-face { fill: #0b1a22; stroke: #c99a45; stroke-width: 3; }
.ss-dash-gauge .g-arc { fill: none; stroke: rgba(240, 214, 160, 0.45); stroke-width: 2; stroke-dasharray: 2 4; }
.ss-dash-gauge .g-needle { stroke: #ff8a5c; stroke-width: 2.4; stroke-linecap: round; transition: transform 0.15s; }
.ss-dash-gauge .g-hub { fill: #e9c47a; }
.ss-game.is-bridge.is-storm .ss-dash { filter: brightness(0.72) saturate(0.85); }
.ss-game.is-bridge .ss-hint.is-top { pointer-events: none; }

@media (max-width: 640px), (max-height: 520px) {
    .ss-dash { height: 16%; min-height: 64px; }
    .ss-dash-wheel { bottom: -112px; }
    .ss-dash-wheel .ss-wheel, .ss-dash-wheel .ss-wheel-box { width: 220px; }
    .ss-dash-wheel .ss-wheel-box { height: 220px; }
    .ss-dash-right .ss-lever { width: 134px; }
    .ss-dash-gauge { width: 54px; } .ss-dash-gauge svg { width: 54px; height: 54px; }
    .ss-compass { width: 190px; margin-left: -95px; top: 8px; }
    .ss-compass-tape { left: 95px; }
    .ss-bridge-hint.ss-hint.is-top { top: 46px; }
}
/* on the bridge the skip button sits low on the left, clear of the compass and the hint */
.ss-stage.is-bridge .ss-skip { top: auto; bottom: calc(17% + 10px); right: auto; left: 12px; }
/* ---- THE STORM AT THE HELM (PLAN-olas-tormenta.md; story-intro.js helmGame) ---- */
/* the windscreen: water on the glass (a canvas), two wipers, the cabin's frame */
.ss-glass { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.ss-glass canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.ss-wiper { position: absolute; left: 0; top: 0; height: 6px; margin-top: -3px; transform-origin: 0 50%; border-radius: 3px;
    background: linear-gradient(180deg, #2a2f33 0, #0b0d0f 55%, #000 100%);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.12); will-change: transform; }
.ss-wiper::before { content: ""; position: absolute; left: -7px; top: -4px; width: 14px; height: 14px; border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #5c6268, #15181b 70%); }
.ss-wiper::after { content: ""; position: absolute; left: 22%; right: 2%; top: 5px; height: 3px; border-radius: 0 0 2px 2px; background: #050607; }
.ss-cab { position: absolute; display: block; }
.ss-cab.is-l, .ss-cab.is-r { top: 0; bottom: 16%; width: max(34px, 7.5vw);
    background: linear-gradient(90deg, #050608 0%, #11161a 55%, #1d252b 88%, rgba(60, 74, 82, 0.9) 100%); }
.ss-cab.is-l { left: 0; clip-path: polygon(0 0, 100% 0, 38% 100%, 0 100%); }
.ss-cab.is-r { right: 0; transform: scaleX(-1); clip-path: polygon(0 0, 100% 0, 38% 100%, 0 100%); }
.ss-cab.is-top { left: 0; right: 0; top: 0; height: max(18px, 4.2vh);
    background: linear-gradient(180deg, #050608 0%, #10151a 75%, #2b363d 100%);
    border-radius: 0 0 50% 50% / 0 0 26% 26%; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6); }
/* a phone: hold either half of the screen to turn */
.ss-game.is-bridge .ss-touch { position: absolute; left: 0; right: 0; top: 96px; bottom: 17%; pointer-events: auto; touch-action: none; }
.ss-touch::before, .ss-touch::after { content: ""; position: absolute; top: 20%; bottom: 20%; width: 46px; opacity: 0; transition: opacity 0.15s; }
.ss-touch::before { left: 0; background: linear-gradient(90deg, rgba(255, 210, 140, 0.32), transparent); border-radius: 0 40px 40px 0; }
.ss-touch::after { right: 0; background: linear-gradient(270deg, rgba(255, 210, 140, 0.32), transparent); border-radius: 40px 0 0 40px; }
.ss-touch[data-side="l"]::before, .ss-touch[data-side="r"]::after { opacity: 1; }
/* the lane on the compass: amber, green with her bow in it */
.ss-compass-fan { position: absolute; left: 50%; top: 3px; bottom: 3px; width: 20px; opacity: 0; border-radius: 8px; transition: opacity 0.25s, background 0.2s;
    background: rgba(255, 160, 60, 0.32); box-shadow: inset 0 0 0 1px rgba(255, 180, 90, 0.8); }
.ss-compass-fan.is-ok { background: rgba(90, 255, 150, 0.32); box-shadow: inset 0 0 0 1px rgba(120, 255, 170, 0.9), 0 0 10px rgba(90, 255, 150, 0.6); }
.ss-game.is-in .ss-wave-warn { color: #7dffb0; text-shadow: 0 0 18px rgba(80, 255, 150, 0.9), 0 2px 6px #000; }
.ss-wave-warn.is-blink { animation: ssBlink 0.22s steps(2) 6; }
@keyframes ssBlink { 50% { opacity: 0.1; } }
/* «Now!»: cut the engine at the crest */
.ss-game.is-bridge .ss-now { position: absolute; right: 3%; bottom: calc(17% + 18px); width: 108px; height: 108px; border-radius: 50%;
    pointer-events: none; opacity: 0; transform: scale(0.7); transition: opacity 0.2s, transform 0.2s;
    border: 3px solid rgba(255, 215, 140, 0.7); color: #fff3cf; cursor: pointer;
    background: radial-gradient(circle at 40% 30%, rgba(120, 70, 25, 0.95), rgba(40, 18, 6, 0.95));
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.55); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.ss-now span { font: 700 1.25rem/1 var(--font-title); letter-spacing: 0.04em; }
.ss-now small { font: 600 9px/1.1 var(--font-title); letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.8; max-width: 80px; text-align: center; }
.ss-game.is-bridge .ss-now.is-on { opacity: 0.75; transform: scale(0.9); pointer-events: auto; }
.ss-game.is-bridge .ss-now.is-hot { opacity: 1; transform: scale(1.06); border-color: #ffe08a;
    box-shadow: 0 0 0 6px rgba(255, 224, 138, 0.25), 0 0 34px rgba(255, 200, 90, 0.9); animation: ssNow 0.32s ease-in-out infinite alternate; }
@keyframes ssNow { to { transform: scale(1.14); } }
/* somebody shouting over the wind */
.ss-crew-call { position: absolute; left: 50%; top: 92px; transform: translate(-50%, -6px); max-width: min(82vw, 560px); padding: 8px 14px; opacity: 0;
    border-radius: 12px; background: rgba(4, 12, 18, 0.78); border: 1px solid rgba(233, 196, 122, 0.4); text-align: center;
    font: 600 0.86rem/1.3 var(--font-body, inherit); color: #f6ead0; transition: opacity 0.2s, transform 0.2s; }
.ss-crew-call b { color: #ffd890; margin-right: 4px; }
.ss-crew-call.is-on { opacity: 1; transform: translate(-50%, 0); }
/* the seas: one mark each, filled as she meets them */
.ss-waves { position: absolute; right: 14px; top: 14px; display: flex; gap: 6px; align-items: flex-end; }
.ss-waves i { display: block; width: 20px; height: 12px; border-radius: 12px 12px 3px 3px; background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(233, 196, 122, 0.35); }
.ss-waves i:last-child { width: 28px; height: 18px; }
.ss-waves i.is-spot { background: #ffd56a; box-shadow: 0 0 10px rgba(255, 213, 106, 0.9); }
.ss-waves i.is-good { background: #e9c47a; }
.ss-waves i.is-mid { background: #9fb4bd; }
.ss-waves i.is-beam { background: #ff7a50; box-shadow: 0 0 8px rgba(255, 110, 70, 0.8); }
.ss-waves::after { content: attr(data-streak); position: absolute; right: 0; top: 24px; font: 700 0.9rem/1 var(--font-title); color: #ffe08a; opacity: 0;
    text-shadow: 0 0 10px rgba(255, 200, 90, 0.9), 0 2px 4px #000; }
.ss-waves.is-streak::after { animation: ssStreak 1.4s ease-out; }
@keyframes ssStreak { 0% { opacity: 0; transform: scale(0.6); } 20% { opacity: 1; transform: scale(1.2); } 80% { opacity: 1; transform: scale(1); } 100% { opacity: 0; } }
.ss-pop.is-big { font-size: clamp(2.2rem, 9vw, 4.4rem); }
.ss-dash-notes { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.ss-game.is-bridge.is-storm .ss-skip { z-index: 3; }
@media (max-width: 640px), (max-height: 520px) {
    .ss-game.is-bridge .ss-now { width: 84px; height: 84px; bottom: calc(16% + 10px); }
    .ss-now span { font-size: 1rem; }
    .ss-crew-call { top: 74px; font-size: 0.78rem; }
    .ss-waves { top: 50px; right: 10px; }
    .ss-game.is-bridge .ss-touch { top: 70px; }
}

/* the intro's faces: a badge for wet / hurt (story-intro.js badge) */
.ss-face-badge { position: absolute; right: -8px; top: -8px; font-style: normal; font-size: 15px; filter: drop-shadow(0 1px 2px #000); }
.ss-face-badge:empty { display: none; }

/* =====================================================================
   THE ROUND'S TABLE (ui.js renderMesa, PLAN-ronda Part 1)
   Gold, turquoise and a wave: the notifications' look, on the round.
   ===================================================================== */
.narrative-line.is-mesa-said { display: none; }
.mesa {
    --mt: #2ac7c7; --mg: var(--gold, #e9c47a); --mgh: var(--gold-hi, #ffe2a0);
    position: relative; margin: 10px 0 6px; padding: 14px 14px 16px; border-radius: 18px;
    background:
        radial-gradient(120% 70% at 50% 0%, rgba(42, 199, 199, 0.10), transparent 60%),
        linear-gradient(180deg, rgba(9, 26, 36, 0.92), rgba(5, 14, 21, 0.95));
    border: 1px solid rgba(233, 196, 122, 0.38);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 240, 200, 0.08);
    overflow: hidden;
}
.mesa::after {   /* the wave along the bottom */
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 10px; pointer-events: none; opacity: 0.55;
    background: radial-gradient(12px 8px at 12px 10px, transparent 7px, rgba(42, 199, 199, 0.6) 8px, transparent 9px) 0 0 / 24px 10px repeat-x;
}

/* 1 · face to face */
.mesa-f2f { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px; }
.mesa-who { margin: 0; display: flex; align-items: center; gap: 10px; min-width: 0; }
.mesa-who.is-chosen { flex-direction: row-reverse; text-align: right; }
.mesa-portrait { position: relative; flex: none; width: 74px; height: 74px; border-radius: 50%; padding: 3px;
    background: conic-gradient(from 200deg, var(--c), var(--mg), var(--c)); box-shadow: 0 0 22px color-mix(in srgb, var(--c) 45%, transparent); }
.mesa-portrait img, .mesa-portrait b { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: grid; place-items: center;
    background: #0a1a24; color: var(--c); font-family: var(--font-title); font-size: 1.6rem; }
.mesa-mood { position: absolute; right: -4px; bottom: -2px; font-style: normal; font-size: 19px; filter: drop-shadow(0 1px 3px #000); }
.mesa-who figcaption { display: flex; flex-direction: column; min-width: 0; }
.mesa-who figcaption b { font-family: var(--font-title); font-size: 1.15rem; letter-spacing: 0.05em; color: var(--c); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mesa-who figcaption b em { font-style: normal; font-size: 0.7em; color: var(--mgh); }
.mesa-who figcaption small { font-size: 0.78rem; color: rgba(255, 255, 255, 0.65); }
.mesa-role { margin-top: 3px; align-self: flex-start; font: 600 0.62rem/1 var(--font-title); letter-spacing: 0.16em; text-transform: uppercase;
    padding: 3px 7px; border-radius: 999px; color: #07161e; background: var(--mg); }
.mesa-who.is-chosen .mesa-role { align-self: flex-end; background: var(--mt); }
.mesa-arrow svg { width: 54px; height: 22px; display: block; }
.mesa-arrow path { fill: none; stroke: var(--mg); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round;
    stroke-dasharray: 80; animation: mesaArrow 1.6s ease-in-out infinite; filter: drop-shadow(0 0 6px rgba(233, 196, 122, 0.7)); }
@keyframes mesaArrow { 0% { stroke-dashoffset: 80; } 45%, 100% { stroke-dashoffset: 0; } }

/* 2 · the three bars */
.mesa-bars { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 10px 14px; margin: 14px 2px 6px; }
.mesa-bar label { display: flex; align-items: center; gap: 5px; white-space: nowrap; font: 600 0.68rem/1 var(--font-title); letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255, 255, 255, 0.8); margin-bottom: 6px; }
.mesa-bar label b { color: #fff; font-size: 0.9rem; }
.mesa-track { position: relative; height: 9px; border-radius: 9px; background: rgba(0, 0, 0, 0.5); border: 1px solid rgba(255, 255, 255, 0.1); }
.mesa-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 9px; transition: width 0.6s ease; }
.mesa-bar.is-desire .mesa-fill { background: linear-gradient(90deg, #b8345c, #ff6f91); box-shadow: 0 0 12px rgba(255, 111, 145, 0.55); }
.mesa-bar.is-trust .mesa-fill { background: linear-gradient(90deg, #127c86, var(--mt)); box-shadow: 0 0 10px rgba(42, 199, 199, 0.5); }
.mesa-bar.is-attr .mesa-fill { background: linear-gradient(90deg, #a67a2a, var(--mgh)); box-shadow: 0 0 10px rgba(233, 196, 122, 0.5); }
.mesa-mark { position: absolute; top: -5px; bottom: -5px; width: 2px; margin-left: -1px; background: rgba(255, 255, 255, 0.35); }
.mesa-mark span { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 11px; opacity: 0.55; filter: grayscale(1); }
.mesa-mark.is-open { background: #ffd3df; }
.mesa-mark.is-open span { opacity: 1; filter: none; }
.mesa-bar.is-desire { padding-bottom: 12px; }
.mesa-q { width: 16px; height: 16px; border-radius: 50%; padding: 0; border: 1px solid rgba(233, 196, 122, 0.6); background: transparent;
    color: var(--mg); font: 700 10px/1 sans-serif; cursor: pointer; margin-left: 2px; }
.mesa-help { margin: 0 2px 8px; padding: 8px 10px; border-radius: 10px; background: rgba(233, 196, 122, 0.1); border: 1px solid rgba(233, 196, 122, 0.3);
    font-size: 0.82rem; color: #f6ead0; }
.mesa-help[hidden] { display: none; }

/* 3 · who is watching */
.mesa-watch { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin: 4px 0 12px; padding: 8px 10px; border-radius: 12px;
    background: rgba(0, 0, 0, 0.28); border: 1px solid rgba(255, 255, 255, 0.07); font-size: 0.82rem; }
.mesa-eye { font-size: 1.1rem; }
.mesa-watcher { display: inline-flex; align-items: center; gap: 5px; color: var(--c); font-family: var(--font-title); font-size: 0.78rem; letter-spacing: 0.05em; }
.mesa-watcher img, .mesa-watcher b { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; border: 2px solid var(--c); background: #0a1a24; display: grid; place-items: center; }
.mesa-watcher.is-partner img { box-shadow: 0 0 0 2px #ff6f91, 0 0 10px rgba(255, 111, 145, 0.7); }
.mesa-watcher.is-ache img { box-shadow: 0 0 0 2px rgba(255, 180, 120, 0.8); }
.mesa-watch-say { margin-left: auto; color: #ffd1b8; font-style: italic; }

/* 4 · tabs and cards */
/* Each tab its own colour: talk = sea blue, intimate = rose, tells = violet. */
.mesa-tabs { display: flex; gap: 8px; margin: 4px 0 12px; }
.mesa-tab { --tc: 120, 200, 230; flex: 1; display: flex; align-items: center; justify-content: center; gap: 9px;
    padding: 10px 10px; cursor: pointer; border-radius: 12px;
    color: rgb(var(--tc)); background: rgba(var(--tc), 0.09); border: 1px solid rgba(var(--tc), 0.28);
    border-bottom: 3px solid rgba(var(--tc), 0.35);
    font: 600 0.82rem/1.15 var(--font-title); letter-spacing: 0.08em; text-transform: uppercase; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
    transition: color 0.2s, background 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.15s; }
.mesa-tab[data-tab="talk"] { --tc: 110, 200, 235; }
.mesa-tab[data-tab="intimate"] { --tc: 255, 110, 150; }
.mesa-tab[data-tab="tells"] { --tc: 185, 140, 255; }
.mesa-tab-ico { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 50%;
    background: rgba(var(--tc), 0.16); box-shadow: inset 0 0 0 1px rgba(var(--tc), 0.35); }
.mesa-tab-ico svg { width: 19px; height: 19px; fill: none; stroke: rgb(var(--tc)); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.mesa-tab[data-tab="intimate"] .mesa-tab-ico svg path:first-child { fill: rgba(var(--tc), 0.25); }
.mesa-tab[data-tab="intimate"] .mesa-tab-ico .ico-cut { fill: rgb(var(--tc)); stroke: none; }
.mesa-tab[data-tab="tells"] .mesa-tab-ico svg path:first-child { fill: rgba(var(--tc), 0.22); }
.mesa-tab i { font-style: normal; font-size: 0.72em; margin-left: 2px; padding: 3px 7px; border-radius: 99px;
    background: rgba(var(--tc), 0.14); color: rgb(var(--tc)); letter-spacing: 0.04em; }
.mesa-tab:hover { color: #fff; background: rgba(var(--tc), 0.16); transform: translateY(-1px); }
.mesa-tab.is-on { color: #fff; background: linear-gradient(180deg, rgba(var(--tc), 0.30), rgba(var(--tc), 0.12));
    border-color: rgba(var(--tc), 0.65); border-bottom-color: rgb(var(--tc));
    box-shadow: 0 0 18px rgba(var(--tc), 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.08); text-shadow: 0 0 10px rgba(var(--tc), 0.6); }
.mesa-tab.is-on .mesa-tab-ico { background: rgb(var(--tc)); }
.mesa-tab.is-on .mesa-tab-ico svg { stroke: #14101e; }
.mesa-tab.is-on[data-tab="intimate"] .mesa-tab-ico svg path:first-child { fill: rgba(20, 16, 30, 0.25); }
.mesa-tab.is-on .mesa-tab-ico .ico-cut { fill: #14101e; }
.mesa-tab.is-on[data-tab="tells"] .mesa-tab-ico svg path:first-child { fill: rgba(20, 16, 30, 0.25); }
.mesa-tab.is-on i { background: rgba(255, 255, 255, 0.16); color: #fff; }
.mesa-pane { display: none; }
.mesa-pane.is-on { display: block; animation: mesaIn 0.25s ease; }
@keyframes mesaIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.mesa-sub { display: flex; align-items: center; gap: 6px; margin: 8px 2px 6px; font: 600 0.66rem/1 var(--font-title); letter-spacing: 0.2em; text-transform: uppercase; color: var(--mg); }
.mesa-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.mesa-card {
    position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; align-items: center; gap: 2px 8px;
    min-height: 56px; padding: 9px 10px; border-radius: 12px; text-align: left; cursor: pointer; color: #fff;
    background: linear-gradient(180deg, rgba(22, 48, 60, 0.92), rgba(10, 26, 36, 0.95));
    border: 1px solid rgba(42, 199, 199, 0.28); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    transition: transform 0.15s ease, border-color 0.2s, box-shadow 0.2s;
}
.mesa-card:hover, .mesa-card:focus-visible, .mesa-card.is-peek { transform: translateY(-2px); border-color: rgba(42, 199, 199, 0.75); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45), 0 0 16px rgba(42, 199, 199, 0.25); }
.mesa-card:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.mesa-ic { grid-row: span 2; font-size: 1.35rem; width: 30px; text-align: center; }
.mesa-name { font-size: 0.86rem; font-weight: 600; line-height: 1.15; }
.mesa-note { grid-column: 2; font-size: 0.72rem; color: #ffc6d4; }
.mesa-effs { grid-column: 2; display: flex; gap: 6px; }
.mesa-eff { font-size: 0.74rem; opacity: 0.9; }
.mesa-eff i { font-style: normal; font-size: 0.7em; margin-left: 1px; color: #8ff0c6; }
.mesa-eff.is-down i, .mesa-eff.is-tension i { color: #ffb08a; }
.mesa-eff.is-tension.is-down i { color: #8ff0c6; }
.mesa-eff.is-desire { color: #ff8fac; } .mesa-eff.is-jealous { color: #ffb08a; } .mesa-eff.is-jealous i { color: #ffb08a; } .mesa-eff.is-trust { color: #6ff0e6; } .mesa-eff.is-attraction { color: var(--mgh); } .mesa-eff.is-tension { color: #ffb08a; }
/* the preview: one line of what happens, opening under the card */
.mesa-peek { grid-column: 1 / -1; max-height: 0; overflow: hidden; opacity: 0; font-size: 0.74rem; line-height: 1.3; color: #dff6f4; font-style: italic;
    transition: max-height 0.25s ease, opacity 0.2s ease, margin 0.2s; }
.mesa-card:hover .mesa-peek, .mesa-card:focus-visible .mesa-peek, .mesa-card.is-peek .mesa-peek { max-height: 4em; opacity: 1; margin-top: 4px; }
@media (hover: none) { .mesa-card:hover .mesa-peek { max-height: 0; opacity: 0; margin-top: 0; } .mesa-card.is-peek .mesa-peek { max-height: 4em; opacity: 1; } }
.mesa-more { margin-top: 8px; }
.mesa-more summary { cursor: pointer; font: 600 0.74rem/1 var(--font-title); letter-spacing: 0.14em; text-transform: uppercase; color: var(--mt); padding: 6px 2px; }

/* the intimate ladder: rungs that climb left to right, the pair standing on theirs */
.mesa-ladder { overflow-x: auto; overflow-y: hidden; padding: 6px 2px 10px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.mesa-steps { display: flex; align-items: flex-end; gap: 8px; min-width: min-content; }
.mesa-step { flex: none; width: 132px; min-height: calc(56px + var(--h, 20px)); align-content: end; scroll-snap-align: center; }
.mesa-step.is-open { border-color: rgba(255, 111, 145, 0.7); background: linear-gradient(180deg, rgba(80, 22, 44, 0.9), rgba(26, 10, 22, 0.95));
    box-shadow: 0 0 18px rgba(255, 111, 145, 0.28); }
.mesa-step.is-next { border-style: dashed; border-color: rgba(255, 198, 212, 0.6); }
.mesa-step.is-far, .mesa-card.is-far { opacity: 0.55; filter: saturate(0.4); }
.mesa-step.is-far .mesa-ic { filter: grayscale(1); }
.mesa-here { flex: none; align-self: stretch; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 2px; padding: 0 2px; }
.mesa-here span { font: 600 0.6rem/1 var(--font-title); letter-spacing: 0.16em; text-transform: uppercase; color: var(--mgh); }
.mesa-here img, .mesa-here b { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; border: 2px solid var(--mg); background: #0a1a24; }
.mesa-here img + img { margin-top: -10px; }
.mesa-here::after { content: ""; width: 2px; flex: 1 0 18px; max-height: 60px; background: linear-gradient(var(--mg), transparent); }

/* "make others play": a drawer with the faces */
.mesa-drawer { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; padding: 8px 10px; border-radius: 12px; background: rgba(42, 199, 199, 0.08); border: 1px dashed rgba(42, 199, 199, 0.35); }
.mesa-drawer p { margin: 0; font-size: 0.82rem; color: rgba(255, 255, 255, 0.8); }
.mesa-pairfaces { display: flex; align-items: center; gap: 4px; color: var(--mt); font-family: var(--font-title); }
.mesa-pairfaces img, .mesa-pairfaces b { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 2px solid var(--mt); background: #0a1a24; }

/* 5 · influence: gold cards with a coin */
.mesa-gold { margin-top: 12px; padding-top: 4px; border-top: 1px solid rgba(233, 196, 122, 0.2); }
.mesa-card.is-gold { border-color: rgba(233, 196, 122, 0.65); padding-right: 54px;
    background: linear-gradient(160deg, rgba(92, 66, 18, 0.95), rgba(40, 26, 6, 0.96)); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 230, 160, 0.25); }
.mesa-card.is-gold:hover { border-color: var(--mgh); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45), 0 0 18px rgba(233, 196, 122, 0.35); }
.mesa-coin { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%;
    display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1;
    background: radial-gradient(circle at 35% 30%, #fff3c8, #e0b057 45%, #8f6420 90%); color: #3a2608;
    font: 700 1rem/1 var(--font-title); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5), inset 0 -2px 3px rgba(80, 50, 10, 0.4); }
.mesa-coin small { font-size: 0.55rem; margin-top: 1px; }

@media (max-width: 720px) {
    .mesa-tab { font-size: 0.72rem; letter-spacing: 0.06em; }
    .mesa-bars { grid-template-columns: 1fr 1fr; }
    .mesa-bar.is-desire { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
    .mesa-who, .mesa-who.is-chosen { flex-direction: column; text-align: center; gap: 4px; }
    .mesa-who figcaption, .mesa-who.is-chosen figcaption { align-items: center; }
    .mesa-role, .mesa-who.is-chosen .mesa-role { align-self: center; }
    .mesa-arrow svg { width: 34px; }
    .mesa-cards.is-gold { grid-template-columns: 1fr; }
    .mesa { padding: 12px 10px 14px; }
    .mesa-portrait { width: 56px; height: 56px; }
    .mesa-who figcaption b { font-size: 0.98rem; }
    .mesa-bars { grid-template-columns: 1fr 1fr; }
    .mesa-bar.is-desire { grid-column: 1 / -1; }
    .mesa-cards { grid-template-columns: 1fr 1fr; }
    .mesa-step { width: 118px; }
    .mesa-tab { font-size: 0.7rem; letter-spacing: 0.06em; padding: 8px 4px; gap: 5px; flex-direction: column; }
    .mesa-tab-ico { width: 26px; height: 26px; }
    .mesa-tab-ico svg { width: 16px; height: 16px; }
    .mesa-watch-say { margin-left: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .mesa-arrow path { animation: none; stroke-dashoffset: 0; } .mesa-pane.is-on { animation: none; } }

/* Influence cards: wide enough that the line reads as a line, not one word
   per row (the user's report, 11-11). The coin sits in its own column. */
.mesa-cards.is-gold { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.mesa-card.is-gold { grid-template-columns: 34px 1fr 46px; padding: 12px 12px 12px 10px; min-height: 64px; }
.mesa-card.is-gold .mesa-ic { grid-row: span 2; font-size: 1.25rem; color: #ffe2a0; }
.mesa-card.is-gold .mesa-name { grid-column: 2; font-family: var(--font-ui); font-size: 0.92rem; font-weight: 600;
    line-height: 1.25; text-wrap: balance; color: #fff6dc; }
.mesa-card.is-gold .mesa-effs, .mesa-card.is-gold .mesa-note { grid-column: 2; }
.mesa-card.is-gold .mesa-coin { position: static; transform: none; grid-column: 3; grid-row: 1 / span 2; align-self: center; justify-self: end; }
.mesa-card.is-gold .mesa-peek { grid-column: 1 / -1; }
.mesa-card .mesa-name { font-family: var(--font-ui); }

/* Cutting in (ui.js offerCutIn): the pair, you watching, two big cards. */
.cutin-box .lf-intro { display: none; }
.cutin-scene { display: flex; align-items: center; justify-content: center; gap: 28px; margin: 6px 0 14px; flex-wrap: wrap; }
.cutin-pair { display: flex; align-items: center; gap: 10px; padding: 8px 16px; border-radius: 999px;
    background: radial-gradient(120% 140% at 50% 50%, rgba(255, 111, 143, 0.14), transparent 70%); }
.cutin-face { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.cutin-face img, .cutin-face b { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 3px solid var(--c);
    box-shadow: 0 0 16px color-mix(in srgb, var(--c) 45%, transparent); display: grid; place-items: center; background: #0a1a24; color: var(--c); }
.cutin-face figcaption { font-family: var(--font-title); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: #fff; }
.cutin-heart { font-size: 1.7rem; color: #ff6f8f; text-shadow: 0 0 14px #ff6f8f; animation: cutinBeat 1.3s ease-in-out infinite; }
@keyframes cutinBeat { 0%, 100% { transform: scale(1); } 20% { transform: scale(1.25); } 40% { transform: scale(1); } }
.cutin-you { position: relative; opacity: 0.92; }
.cutin-you .cutin-face img, .cutin-you .cutin-face b { width: 52px; height: 52px; filter: saturate(0.85); }
.cutin-eye { position: absolute; top: -6px; right: -10px; font-size: 1.1rem; filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.8)); }
.cutin-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 10px; }
.cutin-card { position: relative; display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 10px;
    padding: 14px 14px 14px 12px; border-radius: 14px; text-align: left; cursor: pointer; color: #fff; font-family: var(--font-ui);
    background: linear-gradient(180deg, rgba(22, 48, 60, 0.92), rgba(10, 26, 36, 0.95));
    border: 1px solid rgba(42, 199, 199, 0.35); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4); transition: transform 0.15s ease, box-shadow 0.2s, border-color 0.2s; }
.cutin-card:hover:not(:disabled) { transform: translateY(-2px); border-color: rgba(42, 199, 199, 0.8); box-shadow: 0 10px 22px rgba(0, 0, 0, 0.45), 0 0 16px rgba(42, 199, 199, 0.25); }
.cutin-card.is-gold { border-color: rgba(233, 196, 122, 0.65); background: linear-gradient(160deg, rgba(92, 66, 18, 0.95), rgba(40, 26, 6, 0.96)); }
.cutin-card.is-gold:hover:not(:disabled) { border-color: #ffe2a0; box-shadow: 0 10px 22px rgba(0, 0, 0, 0.45), 0 0 18px rgba(233, 196, 122, 0.35); }
.cutin-card:disabled { opacity: 0.45; cursor: not-allowed; }
.cutin-ic { font-size: 1.7rem; text-align: center; }
.cutin-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cutin-lbl { font-family: var(--font-title); font-size: 1rem; letter-spacing: 0.04em; color: #ffe8b0; }
.cutin-sub { font-size: 0.8rem; color: rgba(255, 255, 255, 0.78); line-height: 1.3; }
.cutin-effs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 3px; }
.cutin-eff { font-size: 0.72rem; padding: 2px 8px; border-radius: 999px; background: rgba(0, 0, 0, 0.35); color: rgba(255, 255, 255, 0.85); }
.cutin-eff.is-bad { color: #ffb08a; } .cutin-eff.is-good { color: #ff9ab4; }
.cutin-card .mesa-coin { position: static; transform: none; }
@media (max-width: 640px) { .cutin-scene { gap: 14px; } .cutin-face img, .cutin-face b { width: 52px; height: 52px; } }
/* what the pair is about to do, shown before you decide */
.cutin-scene { flex-direction: column; gap: 12px; }
.cutin-row { display: flex; align-items: center; justify-content: center; gap: 24px; flex-wrap: wrap; }
.cutin-intent {
    display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 22px 12px; border-radius: 16px;
    background: linear-gradient(180deg, rgba(22, 48, 60, 0.9), rgba(8, 22, 32, 0.95)); border: 1px solid rgba(42, 199, 199, 0.45);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4), 0 0 18px rgba(42, 199, 199, 0.15); animation: cutinIn 0.5s cubic-bezier(.2, 1.3, .4, 1);
}
.cutin-intent.is-intimate { border-color: rgba(255, 111, 143, 0.6); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4), 0 0 20px rgba(255, 111, 143, 0.25);
    background: linear-gradient(180deg, rgba(64, 20, 36, 0.92), rgba(24, 8, 16, 0.95)); }
.cutin-intent-who { font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255, 255, 255, 0.65); font-family: var(--font-title); }
.cutin-intent-act { display: flex; align-items: center; gap: 10px; font-family: var(--font-title); font-size: 1.25rem; color: #fff; letter-spacing: 0.03em; text-align: center; }
.cutin-intent-act i { font-style: normal; font-size: 1.6rem; filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.35)); }
.cutin-intent-with { font-size: 0.8rem; color: rgba(255, 255, 255, 0.75); font-family: var(--font-ui); }
.cutin-intent-with b { color: #8ff0e6; font-weight: 600; }
.cutin-intent.is-intimate .cutin-intent-with b { color: #ff9ab4; }
@keyframes cutinIn { from { opacity: 0; transform: translateY(8px) scale(0.96); } to { opacity: 1; transform: none; } }

/* The pact offer (playstyle.js offerPact): her face, her words in a bubble,
   what the promise means, two big cards. Shares the cutin-* cards. */
.pact-scene { display: flex; flex-direction: column; gap: 12px; margin: 4px 0 14px; }
.pact-row { display: flex; align-items: center; gap: 16px; }
.cutin-face.is-big img, .cutin-face.is-big b { width: 78px; height: 78px; }
.pact-bubble { position: relative; flex: 1; padding: 12px 16px; border-radius: 16px; font-family: var(--font-prose, Georgia, serif);
    font-style: italic; font-size: 0.98rem; line-height: 1.45; color: #f5eee0;
    background: linear-gradient(180deg, rgba(64, 20, 36, 0.85), rgba(26, 10, 18, 0.9)); border: 1px solid rgba(255, 111, 143, 0.45);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4); }
.pact-bubble::before { content: ""; position: absolute; left: -7px; top: 26px; width: 12px; height: 12px; transform: rotate(45deg);
    background: rgba(56, 18, 32, 0.95); border-left: 1px solid rgba(255, 111, 143, 0.45); border-bottom: 1px solid rgba(255, 111, 143, 0.45); }
.pact-terms { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.pact-term { display: flex; align-items: center; gap: 4px; }
.pact-term i { font-style: normal; color: #ff6f8f; text-shadow: 0 0 10px #ff6f8f; animation: cutinBeat 1.3s ease-in-out infinite; }
.cutin-face.is-mini img, .cutin-face.is-mini b { width: 30px; height: 30px; border-width: 2px; }
.cutin-face.is-mini figcaption { display: none; }
.pact-chip { font-size: 0.76rem; padding: 4px 10px; border-radius: 999px; background: rgba(0, 0, 0, 0.35); color: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1); font-family: var(--font-ui); }
.cutin-card.is-love { border-color: rgba(255, 111, 143, 0.6); background: linear-gradient(160deg, rgba(80, 24, 44, 0.95), rgba(30, 10, 20, 0.96)); }
.cutin-card.is-love:hover { border-color: #ff9ab4; box-shadow: 0 10px 22px rgba(0, 0, 0, 0.45), 0 0 18px rgba(255, 111, 143, 0.35); }
@media (max-width: 640px) { .pact-row { flex-direction: column; } .pact-bubble::before { display: none; } }

/* «A la deriva»: the ending in three parts (PLAN-deriva §9, ui.js showEndingModal) */
#endingModal .modal-desc.is-epilogue { font-style: normal; text-align: left; max-height: 46vh; overflow-y: auto; padding-right: 6px; }
#endingModal .modal-desc.is-epilogue p { margin: 0 0 0.55em; }
#endingModal .modal-desc.is-epilogue .story-end-h { margin-top: 1em !important; }

/* =====================================================================
   MARKS — what a decision gave and what it cost (src/marks.js,
   notify.js N.card, PLAN-consecuencias.md §4). Bottom middle, over the
   cinema bar, after the line that says what happened.
   ===================================================================== */
.ntf-why { display: block; font-size: 0.72rem; color: rgba(255, 255, 255, 0.62); margin-top: 1px; white-space: normal; max-width: 230px; line-height: 1.2; }
.mk-card {
    position: fixed; left: 50%; bottom: 21%; z-index: 8650;
    transform: translate(-50%, 18px) scale(0.97); opacity: 0;
    width: min(560px, calc(100% - 32px));
    padding: 14px 18px 12px; border-radius: 18px;
    background: radial-gradient(130% 160% at 50% 0%, rgba(14, 34, 46, 0.97), rgba(4, 12, 20, 0.97));
    border: 1px solid rgba(233, 196, 122, 0.45);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.65), 0 0 30px rgba(127, 233, 228, 0.12);
    color: #fff; pointer-events: auto; cursor: pointer;
    transition: transform 0.45s cubic-bezier(.2, 1.25, .4, 1), opacity 0.35s ease;
    font-family: inherit;
}
.mk-card.is-in { transform: translate(-50%, 0) scale(1); opacity: 1; }
.mk-card.is-out { transform: translate(-50%, 10px) scale(0.98); opacity: 0; transition-duration: 0.3s; }
.mk-kicker { font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(127, 233, 228, 0.8); }
.mk-title { font-family: var(--serif, Georgia, serif); font-size: 1.22rem; color: var(--gold, #e9c47a); margin: 2px 0 8px; letter-spacing: 0.02em; }
.mk-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.mk-cols > .mk-col:only-child { grid-column: 1 / -1; }
.mk-h { font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 5px; font-weight: 600; }
.mk-col.is-gain .mk-h { color: #7fe9c4; }
.mk-col.is-cost .mk-h { color: #ff8a7a; }
.mk-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.mk-item { display: flex; align-items: center; gap: 7px; font-size: 0.95rem; line-height: 1.2; opacity: 0; transform: translateY(6px); }
.mk-card.is-in .mk-item { animation: mkIn 0.42s cubic-bezier(.2, 1.2, .4, 1) forwards; }
.mk-card.is-in .mk-col.is-gain .mk-item:nth-child(2), .mk-card.is-in .mk-col.is-cost .mk-item:nth-child(2) { animation-delay: 0.12s; }
.mk-card.is-in .mk-col.is-gain .mk-item:nth-child(3), .mk-card.is-in .mk-col.is-cost .mk-item:nth-child(3) { animation-delay: 0.24s; }
.mk-card.is-in .mk-col.is-cost .mk-item { animation-delay: 0.3s; }
.mk-card.is-in .mk-col.is-cost .mk-item:nth-child(2) { animation-delay: 0.42s; }
.mk-card.is-in .mk-col.is-cost .mk-item:nth-child(3) { animation-delay: 0.54s; }
@keyframes mkIn { to { opacity: 1; transform: none; } }
.mk-item .ntf-faces { display: inline-flex; }
.mk-item .ntf-face.is-small { width: 24px; height: 24px; margin-right: -6px; }
.mk-item .ntf-faces + .mk-icon { margin-left: 6px; }
.mk-icon { font-size: 1.05rem; width: 1.3em; text-align: center; flex: none; }
.mk-text { color: rgba(255, 255, 255, 0.92); }
.mk-item.is-neg .mk-text { color: #ffd2c9; }
.mk-echo { margin-top: 9px; font-size: 0.8rem; font-style: italic; color: rgba(233, 196, 122, 0.85); }
.mk-tap { position: absolute; right: 14px; bottom: 8px; font-size: 0.66rem; color: rgba(255, 255, 255, 0.4); }
.mk-card.is-summary { bottom: auto; top: 50%; transform: translate(-50%, -46%) scale(0.97); width: min(640px, calc(100% - 32px)); }
.mk-card.is-summary.is-in { transform: translate(-50%, -50%) scale(1); }
.mk-card.is-summary.is-out { transform: translate(-50%, -48%) scale(0.98); }
.mk-rows { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.mk-row { display: grid; grid-template-columns: 1fr; gap: 2px; padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.06);
    opacity: 0; transform: translateY(6px); }
.mk-card.is-in .mk-row { animation: mkIn 0.45s cubic-bezier(.2, 1.2, .4, 1) forwards; }
.mk-card.is-in .mk-row:nth-child(2) { animation-delay: 0.15s; }
.mk-card.is-in .mk-row:nth-child(3) { animation-delay: 0.3s; }
.mk-card.is-in .mk-row:nth-child(4) { animation-delay: 0.45s; }
.mk-card.is-in .mk-row:nth-child(5) { animation-delay: 0.6s; }
.mk-row-t { font-family: var(--serif, Georgia, serif); color: var(--gold, #e9c47a); font-size: 0.95rem; }
.mk-row-g { color: #a8f0d6; font-size: 0.84rem; }
.mk-row-c { color: #ffc4b9; font-size: 0.84rem; }
.mk-door { display: inline-block; margin-left: 6px; font-size: 0.72rem; color: var(--gold, #e9c47a); border: 1px solid rgba(233, 196, 122, 0.45); border-radius: 999px; padding: 0 7px; vertical-align: middle; }
.mk-hurt-badge { margin-left: 4px; font-size: 0.85em; }
.story-day-m { display: block; font-size: 0.8rem; color: rgba(255, 255, 255, 0.75); margin-top: 4px; font-style: italic; }
@media (max-width: 560px) {
    .mk-cols { grid-template-columns: 1fr; }
    .mk-card { bottom: 18%; padding: 12px 14px 10px; }
}
@media (prefers-reduced-motion: reduce) {
    .mk-card, .mk-item, .mk-row { transition: none; animation: none !important; opacity: 1; transform: translate(-50%, 0); }
    .mk-item, .mk-row { transform: none; }
}

/* LOSS — your own death on the end screen (src/loss.js) */
.loss-extra { margin-top: 14px; text-align: center; }
.loss-extra .loss-you { font-family: var(--serif, Georgia, serif); font-style: italic; color: rgba(255, 255, 255, 0.86); margin: 0 0 10px; }
.loss-extra .loss-dawn { display: inline-block; padding: 8px 18px; border-radius: 999px; border: 1px solid rgba(233, 196, 122, 0.6);
    background: rgba(233, 196, 122, 0.12); color: var(--gold, #e9c47a); cursor: pointer; font: inherit; letter-spacing: 0.04em; }
.loss-extra .loss-dawn:hover { background: rgba(233, 196, 122, 0.22); }
.player-mark-note { opacity: 0.92; }

/* --- Sway cards (renderSwayOptions): icon, what it does, a coin ----------- */
.sway-head { align-items: center; }
.sway-purse { display: inline-flex; align-items: center; gap: 3px; }
.sway-purse b { margin-left: 6px; font: 700 0.95rem/1 var(--font-title); color: var(--gold-hi, #ffe3a0); }
.sway-gem { width: 10px; height: 10px; transform: rotate(45deg); border-radius: 2px;
    background: linear-gradient(135deg, #fff3c8, #e0b057 50%, #8f6420); box-shadow: 0 0 6px rgba(244, 199, 94, 0.55);
    animation: swayGem 0.35s ease backwards; animation-delay: var(--d, 0s); }
@keyframes swayGem { from { opacity: 0; transform: rotate(45deg) scale(0.3); } }
.sway-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.sway-card {
    position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; align-items: center; gap: 2px 10px;
    min-height: 64px; padding: 10px 52px 10px 10px; border-radius: 14px; text-align: left; cursor: pointer; color: #fff; font: inherit;
    background: radial-gradient(120% 140% at 0% 0%, rgba(244, 199, 94, 0.14), transparent 55%), linear-gradient(180deg, rgba(20, 50, 62, 0.95), rgba(8, 24, 34, 0.97));
    border: 1px solid rgba(244, 199, 94, 0.32); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 230, 160, 0.12);
    transition: transform 0.15s ease, border-color 0.2s, box-shadow 0.2s;
}
.sway-card:hover:not(:disabled), .sway-card:focus-visible { transform: translateY(-3px); border-color: rgba(255, 220, 140, 0.85);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.5), 0 0 20px rgba(244, 199, 94, 0.3); }
.sway-card:active:not(:disabled) { transform: translateY(-1px) scale(0.98); }
.sway-card:disabled { cursor: not-allowed; opacity: 0.5; filter: saturate(0.35); }
.sway-ic { grid-row: span 2; position: relative; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.18), rgba(0, 0, 0, 0.25)); border: 1px solid rgba(244, 199, 94, 0.45);
    transition: transform 0.2s ease; }
.sway-card:hover:not(:disabled) .sway-ic { transform: scale(1.1) rotate(-6deg); }
.sway-ic img, .sway-ic b { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.sway-ic em { position: absolute; right: -4px; bottom: -4px; font-style: normal; font-size: 0.85rem; }
.sway-name { font: 600 0.9rem/1.15 var(--font-ui); }
.sway-sub { grid-column: 2; font-size: 0.74rem; line-height: 1.2; color: rgba(226, 252, 248, 0.68); }
.sway-card:disabled .sway-sub { color: #ffb08a; }
.sway-coin { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; gap: 1px; line-height: 1;
    background: radial-gradient(circle at 35% 30%, #fff3c8, #e0b057 45%, #8f6420 90%); color: #3a2608;
    font: 700 0.95rem/1 var(--font-title); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5), inset 0 -2px 3px rgba(80, 50, 10, 0.4); }
.sway-coin small { font-size: 0.55rem; }
.sway-card.is-free .sway-coin { width: auto; padding: 0 8px; height: 22px; border-radius: 999px; font: 700 0.62rem/1 var(--font-title);
    letter-spacing: 0.1em; text-transform: uppercase; color: #032; background: linear-gradient(180deg, #8ff0e6, #2ac7c7); box-shadow: 0 0 12px rgba(42, 199, 199, 0.5); }
.sway-peek { grid-column: 1 / -1; max-height: 0; overflow: hidden; opacity: 0; font-size: 0.74rem; line-height: 1.3; font-style: italic; color: #dff6f4;
    transition: max-height 0.25s ease, opacity 0.2s ease, margin 0.2s; }
.sway-card:hover .sway-peek, .sway-card:focus-visible .sway-peek { max-height: 5em; opacity: 1; margin-top: 6px; }
@media (hover: none) { .sway-peek { display: none; } }
.personal-panel { background: linear-gradient(180deg, rgba(255, 90, 110, 0.06), rgba(255, 90, 110, 0.01)); border-color: rgba(255, 120, 130, 0.22); }
.sway-card.is-grim { padding-right: 12px; border-color: rgba(255, 120, 130, 0.4);
    background: radial-gradient(120% 140% at 0% 0%, rgba(255, 90, 110, 0.16), transparent 55%), linear-gradient(180deg, rgba(48, 22, 32, 0.95), rgba(20, 10, 16, 0.97)); }
.sway-card.is-grim .sway-name { color: #ff9aa6; }
.sway-card.is-grim .sway-ic { border-color: rgba(255, 120, 130, 0.6); }
.sway-card.is-grim:hover { border-color: rgba(255, 140, 150, 0.85); box-shadow: 0 10px 22px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 90, 110, 0.3); }
@media (max-width: 520px) { .sway-cards { grid-template-columns: 1fr 1fr; } .sway-card { padding-right: 46px; } .sway-ic { width: 34px; height: 34px; } }
@media (prefers-reduced-motion: reduce) { .sway-gem { animation: none; } .sway-card, .sway-ic { transition: none; } }

/* the speaker's face in the bubble, and the stem from its tail to their head */
.ss-bubble-name { display: flex; align-items: center; gap: 6px; }
.ss-bubble-face { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; border: 1px solid var(--c); flex: none; }
.ss-stem {
    position: absolute; z-index: 4; width: 2px; margin-left: -1px; height: 0; left: 0; top: 0;
    transform-origin: 50% 0; pointer-events: none; opacity: 0; transition: opacity 0.2s ease;
    background: linear-gradient(180deg, color-mix(in srgb, var(--c, #e9c47a) 80%, transparent), color-mix(in srgb, var(--c, #e9c47a) 20%, transparent));
}
.ss-stem.is-on { opacity: 0.9; }
.ss-bubble.is-below { transform: translate(-50%, 0) scale(0.92); }
.ss-bubble.is-below.is-on { transform: translate(-50%, 0) scale(1); }
.ss-bubble.is-below::after { bottom: auto; top: -7px; transform: translateX(-50%) rotate(225deg); }

/* --- The round strip: who acts -> WHAT -> who it lands on (ui.js roundBanner) --- */
#roundTitle .rb { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; }
.rb-no {
    font-family: 'Cinzel', serif; font-size: 0.62em; letter-spacing: 0.2em; text-transform: uppercase;
    color: rgba(233, 196, 122, 0.85); padding: 5px 11px 4px; border-radius: 999px;
    border: 1px solid rgba(233, 196, 122, 0.4); background: rgba(233, 196, 122, 0.07); text-shadow: none; white-space: nowrap;
}
.rb-flow { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; min-width: 0; }
.rb-name { color: var(--c, #fff); text-shadow: 0 0 14px color-mix(in srgb, var(--c, #fff) 45%, transparent); white-space: nowrap; }
.rb-amp { color: rgba(255, 255, 255, 0.5); font-size: 0.8em; }
.rb-line { position: relative; width: 26px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, rgba(233, 196, 122, 0.15), rgba(233, 196, 122, 0.75)); }
.rb-line.rb-arrow { background: rgba(233, 196, 122, 0.8); margin-right: 5px; }
.rb-line.rb-arrow::after {
    content: ""; position: absolute; right: -2px; top: 50%; width: 7px; height: 7px;
    border-top: 2px solid rgba(233, 196, 122, 0.95); border-right: 2px solid rgba(233, 196, 122, 0.95);
    transform: translateY(-50%) rotate(45deg);
}
.rb-act {
    display: inline-flex; align-items: center; gap: 9px; padding: 6px 15px 6px 11px; border-radius: 999px;
    font-family: 'Outfit', sans-serif; font-size: 0.78em; font-weight: 600; letter-spacing: 0.02em; text-shadow: none;
    color: #fff; white-space: nowrap;
    border: 1px solid rgba(126, 214, 223, 0.55);
    background: linear-gradient(180deg, rgba(126, 214, 223, 0.2), rgba(10, 30, 42, 0.75));
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), 0 0 18px rgba(126, 214, 223, 0.18);
}
.rb-act i { font-style: normal; font-size: 1.25em; line-height: 1; filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.35)); }
.rb-act em { font-style: normal; }
.rb-act.is-intimate {
    border-color: rgba(255, 111, 143, 0.65);
    background: linear-gradient(180deg, rgba(255, 111, 143, 0.26), rgba(42, 10, 24, 0.75));
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), 0 0 20px rgba(255, 111, 143, 0.28);
}
.rb-act.is-set { animation: rbPop 0.55s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
.rb-act.is-pending {
    color: rgba(255, 255, 255, 0.7); font-weight: 500; border-style: dashed; border-color: rgba(233, 196, 122, 0.45);
    background: rgba(233, 196, 122, 0.06); box-shadow: none;
}
.rb-act .rb-dots { display: inline-flex; gap: 4px; filter: none; font-size: 1em; }
.rb-dots s { width: 5px; height: 5px; border-radius: 50%; background: rgba(233, 196, 122, 0.9); animation: rbDot 1.2s ease-in-out infinite; }
.rb-dots s:nth-child(2) { animation-delay: 0.15s; }
.rb-dots s:nth-child(3) { animation-delay: 0.3s; }
@keyframes rbDot { 0%, 100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@keyframes rbPop { 0% { opacity: 0; transform: scale(0.6); } 60% { opacity: 1; transform: scale(1.08); } 100% { transform: scale(1); } }
@media (max-width: 720px) {
    .rb-line { width: 14px; }
    .rb-act { font-size: 0.72em; padding: 5px 12px 5px 9px; }
}
@media (prefers-reduced-motion: reduce) { .rb-act.is-set, .rb-dots s { animation: none; } }
